use std::io::Read; fn main() { let mut input = String::new(); std::io::stdin().read_to_string(&mut input).unwrap(); let mut input = input.split_whitespace(); let t: usize = input.next().unwrap().parse().unwrap(); let s: usize = input.next().unwrap().parse().unwrap(); let d: usize = input.next().unwrap().parse().unwrap(); let mut ans = 0.0f64; let mut remain = d; let mut now = t; while s <= remain { if 18 <= now || now < 6 { ans += 1.0; } remain -= s; now += 1; if now == 24 { now = 0; } } if 18 <= now || now < 6 { ans += remain as f64 / s as f64; } println!("{:.15}", ans); }