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
s=raw_input()
h=float(s[0:2])
m=float(s[3:5])
h=h*30.0+m/2.0
m=m*6.0
diff=abs(h-m)
if diff>=180:
 diff=360-diff
print '%.6f' % diff