Start: Mar, 27, 2015 15:30:00
2015年省赛最终选拔赛Round#3
End: Mar, 27, 2015 18:30:00
Time elapsed:
Time remaining:

Two DIAOSI’ s Game 1496

Time Limit:  1 s      Memory Limit:   32 MB
Submission:65     AC:5     Score:1

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