t, s, d = map(int, input().split()) if 0 <= t <= 6: t += 24 drive = d / s ans = drive // 24 if ans >= 1: print(drive + 12 * ans) else: if drive > 12: print(30 - t) else: print(drive)