type [] s = static member toS (x: int) = x * 1 type [] m = static member m2s (m: int) = m * 60 static member toM (x: int) = x * 1 type [] h = static member h2s (h: int) = h * 3600 static member toH (x: int) = x * 1 let solve a b c = let a' = a |> m.m2s let c' = c |> h.h2s let x = (c', a' - b) match x with | _, x when x < 0 -> None | x, y when x % y = 0 -> Some(x / y) | x, y -> Some(x / y + 1) let A, B, C = let t = stdin.ReadLine().Split() |> Array.map int m.toM t.[0], s.toS t.[1], h.toH t.[2] solve A B C |> function | Some(x) -> x | None -> -1 |> stdout.WriteLine