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
'''
# Read input from stdin and provide input before running code

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''
base_h_angle = 360.0/12.0
base_hm_angle= 30.0/60.0
base_m_angle = 360.0/60.0
h_angel, m_angel = 0,0
time = raw_input("")
h,m = time.split(':')
h_angle = int(h)%12*base_h_angle+int(m)%60*base_hm_angle
m_angle = int(m)*base_m_angle

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