The value of the above table is defined as .
(Note: represents the greatest integer smaller than . E.g. )
Fluffy’s homework is to find the minimum number of 90° clockwise rotations to maximise the value of the table.
A 90° clockwise rotation looks like the following:
In the above example, the table’s initial value is while the table’s value after one rotation is .
Help Fluffy with his homework!
Input Format
There are two lines of input.

The first line contains two integers and .

The second line contains two integers and .
Constraints
Output Format
Output an integer , the minimum number of 90° clockwise rotations needed to maximise the table’s value.
Sample Input
1 2
3 4
Sample Output
2
Explanation
After 2 rotations, the table’s value is , which is the maximum possible.
(How do I solve that in C++?)