def calc(x): return (x // 24) * 12 + min(x % 24, 12) t, s, d = map(int, input().split()) l = t + 6 r = l + d / s print(f'{calc(r) - calc(l):.15f}')