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
import math
def CalAngle(h,m):
    if h < 0 or m < 0 or h > 12 or m > 60:
        return 0
    if h==12:
        h=0
    if m==60:
        m=0
    hour_angle = 0.5*(h*60+m)
    min_angle = 6*m
    angle = abs(hour_angle-min_angle)
    angle = min(360-angle,angle)
    return angle

x,y=map(int,raw_input().split(':'))
print "%.6f"%(CalAngle(x,y))