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 decimal import *
getcontext.prec=6
x=raw_input()
hr=Decimal(x[0:2])
mn=Decimal(x[3:5])

hhand=Decimal(hr*Decimal(30)+Decimal(0.5)*mn)
#if(hhand>=360):
#	hhand=hhand-Decimal(360)

mhand=Decimal(6*mn)


a=abs(hhand-mhand)
b=abs(mhand-hhand)

if(a>180):
	print("%.6f"%(360-a))
else:
	print("%.6f"%a)