Maximum Value of a Fraction Table

Time limit1sMemory limit128 MB

Problem

Sanggeun is not good at addition or division. Jeongin gave him a 2*2 table made of positive integers A, B, C, and D.

AB
CD

The value of the table is defined as A/C + B/D.

Sanggeun wants to know how many times he should rotate the table clockwise by 90 degrees so that the value becomes as large as possible. The original table is considered to have been rotated 0 times.

After 1 clockwise rotation, the table becomes:

CA
DB

After 2 clockwise rotations, the table becomes:

DC
BA

Given A, B, C, and D, write a program that prints the number of rotations that maximizes the table value.

Input

The first line contains A and B separated by a space. The second line contains C and D separated by a space. Every number is a positive integer at most 100.

Output

Print how many times the table should be rotated to maximize its value. If more than one rotation count gives the maximum value, print the smallest such count.