Given the time shown by a wall clock, you have to output the internal angle between the minute and hour hand of the clock.
(Wall Clock displays a 12 hour format.)

For instance, if the time shown is 01:00 , the angle between the hands is 30 degrees.

Input : Time in HH:MM format 
Output: The angle in degrees, correct up to 6 places of decimal.

SAMPLE INPUT
04:00

SAMPLE OUTPUT
120.000000
# Get internal angle between
# hour and minutes hand
# in a Wall clock

h, m = map(int, raw_input().split(':'))

ha = h * 30
ma = m * 6

hma = float(m) / 2
acha = ha + hma

result = abs(acha - ma)
if result > 180:
    result = 360 - result
print '{0:.6f}'.format(result)