#abc188f. [abc188_f]+1-1x2
[abc188_f]+1-1x2
Problem Statement
Takahashi has written an integer on a blackboard. He can do the following three kinds of operations any number of times in any order:
- increase the value written on the blackboard by ;
- decrease the value written on the blackboard by ;
- multiply the value written on the blackboard by .
Find the minimum number of operations required to have written on the blackboard.
Constraints
- and are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the answer.
Sample Input 1
3 9
Sample Output 1
3
Initially, is written on the blackboard. The following three operations can make it :
- increase the value by , which results in ;
- multiply the value by , which results in ;
- increase the value by , which results in .
Sample Input 2
7 11
Sample Output 2
3
The following procedure can make the value on the blackboard :
- decrease the value by , which results in ;
- multiply the value by , which results in ;
- decrease the value by , which results in .
Sample Input 3
1000000000000000000 1000000000000000000
Sample Output 3
0
If the value initially written on the blackboard equals , print .