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
'''
import math

strTime = raw_input()
arTime = strTime.split(':')
hour = float(12 if arTime[0] == 0 else arTime[0])
mint = float(arTime[1])



hrAngle = 30*hour + mint/2
minAngle = 6 * mint

angleDiff = math.fabs(hrAngle - minAngle)
if angleDiff > 180:
	angleDiff = 360 - angleDiff

print '{0:.6f}'.format(angleDiff)
#echo number_format((float)$angleDiff, 6);