M. Playing with magnets
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Three wheels 1, 2 and 3 with rim lengths of $$$k$$$, $$$l$$$ and $$$m$$$ centimeters rotate freely on the axes. The wheels' axes are fixed on a straight beam from left to right so that wheel 1 comes into contact with wheel 2, and wheel 2 comes into contact with wheel 3. If you rotate wheel 1, it will transfer rotation to wheel 2, and then, in turn, to wheel 3.

Magnets of different strengths are fixed next to the wheel rims every centimeter. For simplicity, the strength of the magnets is denoted by integers from 1 (the weakest magnet) to $$$max(k, l, m) $$$ (the strongest). The magnets of the first wheel have a force of $$$1, 2, 3, ..., k$$$, of the second – $$$ 1, 2, 3, ..., l $$$, the third – $$$ 1, 2, 3, ..., m $$$. On each wheel, the magnets are arranged strictly in ascending order and counterclockwise direction (except for the strongest and weakest magnets standing side by side).

Initially, the wheels are positioned so that the weakest magnets (with a force of 1) are in the leftmost position. A magnet with a force of 200 (stronger than any other magnet on wheels) is fixed next to the rightmost point of wheel 3.

The first wheel starts rotating at a speed of 1 cm of rim per second clockwise. Accordingly, the second wheel rotates at the same speed, but counterclockwise. The third wheel rotates at the same speed, but again clockwise. An iron ball is fixed on the magnet 1 of the first wheel. During the rotation of the wheels, the ball can move from a weak magnet to a stronger one, but only at the points where the wheels connect, or from the rightmost position of the wheel 3 to the magnet with a force of 200.

Write a program that, based on the given numbers $$$k$$$, $$$l$$$ and $$$ m$$$ determines whether the ball will ever be on the magnet 200, and if it gets there, then how many seconds after the wheels start rotating.

Input

The input contains three integers $$$k$$$, $$$l$$$ and $$$m$$$($$$4\leq k,l,m\leq 100$$$, all $$$k, l, m$$$ – even), separated by spaces.

Output

Output the number of seconds from the start of rotation to the moment when the ball gets to the magnet 200, or -1, if it will never be on it.

Examples
Input
4 6 8
Output
9
Input
4 8 4
Output
-1
Input
4 4 4
Output
-1
Note
Example for wheels, sizes 4, 6 and 8.