Start: Jul, 24, 2015 12:00:00
ACM队暑期组队赛Round#4
End: Jul, 24, 2015 17:00:00
Time elapsed:
Time remaining:

Two DIAOSI’ s Game 1496

Time Limit:  1 s      Memory Limit:   32 MB
Submission:39     AC:9     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