Farmer John has received information about the location of a runaway cow, and he immediately sets off to catch her. He starts at point on the number line, while the cow is located at point on the same line. Farmer John has two modes of transportation:
Walking: FJ can move from any point to x - 1 or x + 1 in one minute;
Teleportation: FJ can move from any point to 2 \cdot x in one minute.
Since the cow is unaware of being pursued, she does not move. Determine the minimum amount of time it will take Farmer John to catch her.
A single line contains two integers and k~(0 \le n, k \le 10^5) — the starting positions of Farmer John and the cow, respectively.
Print the minimum number of minutes required for Farmer John to reach the cow.
The fastest path for Farmer John to reach the runaway cow is: 5 \rightarrow 10 \rightarrow 9 \rightarrow 18 \rightarrow 17, which takes minutes.
Example 1