eolymp
Problems

Valya and a letter

Valya and a letter

Valya was tired of social networks and decided to write a letter to her friend Sasha on a rectangular sheet of paper. The lengths of the sides of the sheet are equal to n and m centimeters. Then she found a rectangular envelope with side lengths equal to h and w centimeters.

Unfortunately, the letter may not fit into the envelope, in this case Valya have to fold the letter several times. In one action, Valya can fold the letter in half vertically or horizontally.

After Valya, if necessary, folds the letter in half several times, she plans to put it into the envelope. Valya is a very neat girl, she always puts a letter in an envelope so that its sides are parallel to the sides of the envelope. A letter is placed in an envelope if its sides are not longer than the corresponding sides of the envelope. Before putting the letter into the envelope, Valya can rotate it 90 degrees. For example, if the lengths of the sides of the letter are 10 and 20 centimeters, and the lengths of the sides of the envelope are 20 and 10 centimeters, Valya does not need to fold the letter, she can rotate it 90 degrees and put into an envelope.

Valya does not want the letter to be very wrinkled, so she wants to fold the letter in half the minimum number of times. Help her figure out the minimum number of times she has to fold the letter before she can put it in the envelope.

Input

The first line contains four integers n, m, h and w (1n, m, h, w1018), the lengths of the sides of the letter and envelope, respectively.

Output

Print one number, the minimum number of times Valya has to fold the letter so that she can put it into the envelope.

Time limit 1 second
Memory limit 128 MiB
Input example #1
10 20 20 10
Output example #1
0
Input example #2
3 3 2 2
Output example #2
2
Input example #18
576460752303423489 576460752303423489 1 1
Output example #18
120
Source 2018 XXVI Командный чемпионат школьников Санкт-Петербурга по программированию, October 18, Problem А