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
time = raw_input()
hr=int(time.split(':')[0])
min=int(time.split(':')[1])

if (hr == 12):
        hr = 0

if (min == 60):
        min = 0


ang_hr= ((60.00000*hr)+min)/2
ang_min = 6.00000*min
result = abs(ang_hr - ang_min)
if result > 180:
	result = 360 - result
#result = abs((30*hr)-11*(min/2))
print '{0:.6f}'.format(result)