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
'''
hours, minutes = map(float, raw_input().split(':'))
degree_per_min = 6.000000
hours += minutes/60.0 
minutes %= 60.0 
hour_pos_in_min = (hours % 12.0) * 5.0
out = abs(hour_pos_in_min - minutes) * degree_per_min
if out > 180:
	out = out - 180.0 
print "%.6f" % (out)