The number of viewers watching live stream of "The Fallen Man" is increasing at a tremendous rate. Gilfoyle's homemade server "Anton" can give up anytime soon. But the team Pied Piper has decided to give all they can to make this live stream a success. To run the server optimally, GIlfoyle has connected multiple GPUs using pieces of wires. The connecting wires are of two types: Red and Green. GIlfoyle tells you that number of GPU's running simultaneously can be controlled by removing the wired connections. When a Red piece of wire is removed, the number of GPUs running simultaneously become twice the current number. On the other hand, when a Green piece of wire is removed, the number of GPUs running simultaneously become one less than the current number. Richard is busy with the lawsuit. Dinesh is busy handling the coding part. Even Erlich has started helping Dinesh in coding (despite the fact that he is suffering from Carpal Tunnel Syndrome). Gilfoyle and Jared are busy setting up the wiring of the server. It's your chance to help Gilfoyle in finding the minimum number of pieces of wire (both Red and Green) to be removed to set the number of GPUs running simultaneously, to some given number.
INPUT
A single line containing input of the form: N M, where N is the current number of GPUs running simultaneously, and, M is the number of GPUs required to run simultaneously.
OUTPUT
One line containing minimum number of pieces of wire to be removed to change the N number of simultaneously running GPUs to M number of GPUs.
CONSTRAINTS
1 <= N, M <= 100000
A sample for understanding:
Input:
1 3
Output:
3
Explaination:
The number of GPUs running simultaneously is 1. You can reach from 1 to 3 GPUs using these steps:
1 -> 2 (By removing a Red piece of wire)
2 -> 4 (By removing a Red piece of wire)
4 -> 3 (By removing a Green piece of wire)
Hence, 3 pieces of wire are removed.
Current number of GPUs running simultaneously are 2. You have to run 10 GPUs simultaneously. This can be done by following these steps:
2 -> 4 -> 3 -> 6 -> 5 -> 10.
Hence 5 pieces of wire are to be removed.