import math T, S, D = map(int, input().split()) H = D / S start = T end = start + H total = 0.0 k_min = math.floor((start - 30) / 24) k_max = math.ceil((end - 18) / 24) for k in range(k_min, k_max + 1): night_start = 18 + 24 * k night_end = 30 + 24 * k overlap_start = max(start, night_start) overlap_end = min(end, night_end) if overlap_start < overlap_end: total += overlap_end - overlap_start print("{0:.15f}".format(total))