Symmetry
Farmer John loves symmetry and is currently arranging his cows on his field partitioned into an grid.
To preserve symmetry, Farmer John places cows in the following way. He puts a cow in the very center grid-square of the field; if no such grid-square exists, he simply stops. Then he partitions the field into four equal-sized smaller fields (separated by the row and column of the cow in the center) and arranges cows on each of those fields as before. He repeats the partitioning for ever-smaller fields until no center grid-square of a field exists or the field cannot be subdivided.
By way of example, if and then Farmer John will place a cow in row , column and arrange each of the resulting fields. In each of the fields, Farmer John will place a cow in row , column and arrange each of the resulting fields. The process is shown here (where denotes a cow):
cows are required for this field. On the other hand, if then Farmer John will only need to place one cow since the resulting fields do not have center grid-squares. Help Farmer John determine how many cows he needs to arrange his field.
Input
Two integers and .
Output
Print the number of cows needed.