HZNUOJ

Two DIAOSI’ s Game

Tags:
Time Limit:  1 s      Memory Limit:   32 MB
Submission:209     AC:37     Score:97.89

Description

The Qingming Festival is coming soon, and the Loser named ydw is a single dog. He feel peculiarly boring, so he wants to play with Loser yybird. Unfortunately, Loser yybird is dating with Goddess loy. Loser ydw is so jealousy that he decides to find them and destroy their dating.

Suppose ydw’s position in coordinate axis is n while yybird’s position is m. (1 ≤ n, m ≤ 10^4), The Loser ydw walks in an unusual way that he has two choices in each step, one is backing to p-1 and the other is going to 2p (p is the current position of ydw).

Then, you are so kind that you will help ydw to calculate the absolute minimum steps he need to take so that he can reach the place where yybird and loy are dating.

Input

Two integers n and m.

Output

The minimum steps.

Samples

input
4 6
output
2

Author

CHEN, Jiachi