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
import math
time=raw_input()

hour=int(time[0:2])
minute=int(time[3:5])

angle= 360 / 60

hr_angle=angle*hour*5 + (5/60.0) * minute * angle
min_angle=angle*minute

f_angle=hr_angle-min_angle
f_angle=math.copysign(f_angle,+0.0)

f_angle=f_angle if(f_angle<=180) else (360-f_angle)

print '{0:.6f}'.format(f_angle)