#000393

O-angle meter

Little Gondra received a digital angle meter as a gift. While measuring an angle the display shows numbers representing: degrees, minutes and seconds of the measured angle. Gondra enjoys measuring angles whole day, and he wants to know what is first integer fraction of the measured angle he can not measure with his new digital angle meter.


InputThe first row contains a measurement for an angle, in the format D° M' S”.
(0 <= D <= 2^31), (0 <= M <= 59) i (0 <= S <= 59). At least one of numbers D, M or S will be greater then zero. All numbers are integers. There is a white space after the signs for degree and minute: ° and '.

OutputOutput an integer - the first integer fraction of the measured angle that can not be measured with his instrument.

Input:
0° 1’ 0”


Output:
7


Input:
13° 14’ 12”


Output:
5


Explanation for first example

• 1/2 of angle is 0° 0’ 30” – this is possible to measure.
• 1/3 of angle is 0° 0’ 20” – this is possible to measure.
• 1/4 of angle is 0° 0’ 15” – this is possible to measure.
• 1/5 of angle is 0° 0’ 12” – this is possible to measure.
• 1/6 of angle is 0° 0’ 10” – this is possible to measure.
• 1/7 of angle is 0° 0’ 8.5714” – this is first part Gondra can not measure.

So the answer is 7.

Submit solution

Coming later

The grading service will be connected in a later migration step. You can inspect the task and your previous results now.