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
from math import *
string=raw_input()
h=string[0:2]
m=string[3:5]
if(h==12):
	h=0
x=30*int(h)+int(m)/2.0
y=6*int(m)-x
y=abs(y)
if y>180:
	print "%0.6f" %(360-y)
else:
	print "%0.6f" %(y)