a, b = map(int, input().split()) rad_a = ((a / 12 + b / 60 * (1 / 12)) * 360) % 360 rad_b = b / 60 * 360 % 360 rad_d = rad_a - rad_b if rad_d < 0: rad_d += 360 # 長 # 60秒で1 / 60 * 360ド # 1秒で1/10ド # 短: # 60秒で1 / (12 * 60) * 360ド # 1秒で1 / (12 * 60 * 60) * 360 diff = 1 / 10 - 30 / (60 * 60) print(int(rad_d / diff + 0.5))