type [] s = static member toS (x: int64) = x * 1L type [] m = static member m2s (m: int64) = m * 60L static member toM (x: int64) = x * 1L type [] h = static member h2s (h: int64) = h * 3600L static member toH (x: int64) = x * 1L 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 < 0L -> None | x, y when x % y = 0L -> Some(x / y) | x, y -> Some(x / y + 1L) let A, B, C = let t = stdin.ReadLine().Split() |> Array.map int64 m.toM t.[0], s.toS t.[1], h.toH t.[2] solve A B C |> function | Some(x) -> x | None -> -1L |> stdout.WriteLine