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()).split(":")
h=int(time[0])
m=int(time[1])

h_= 30.0
m_= 6.0
hm_=1.0/2.0

h_angle=h_*h+m*hm_
m_angle=m_*m

if h_angle<m_angle:
   temp=h_angle
   h_angle=m_angle
   m_angle=temp

if h_angle-m_angle>180:
	print "%.6f" % (360+m_angle-h_angle)
else:
	print "%.6f" % (h_angle-m_angle)