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
def hours_to_degrees(hours, minutes):
	return hours*30 + .5*minutes
	
def minutes_to_degrees(minutes):
	return 6*minutes
	
def get_angle(the_time):
	time = the_time.split(":")
	hrs = float(time[0]) % 12
	#hrs = (float(time[0]) if float(time[0]) <=12 else (24 - float(time[0])))
	minutes = float(time[1])

	#print hrs
	#print minutes
	hr_deg = hours_to_degrees(hrs, minutes)
	min_deg = minutes_to_degrees(minutes)
	diff = hr_deg - min_deg
	if (diff < 0):
		diff = diff*-1
	if(diff> 180):
		diff = diff - 180
	print "%.6f" % diff
	

#get_angle("12: 00")
get_angle(raw_input())