using System.Numerics; public class Program { public static void Main() { //int num = int.Parse(Console.ReadLine() ?? string.Empty); string[] str = (Console.ReadLine() ?? string.Empty).Trim().Split(' '); //string str = Console.ReadLine() ?? string.Empty; BigInteger mi = BigInteger.Parse(str[0]); BigInteger sec = BigInteger.Parse(str[1]); BigInteger time = BigInteger.Parse(str[2]); if(mi == 1) { Console.WriteLine(-1); return; } int count = 0; while(count < 114516) { count++; BigInteger hand = (60 * mi) * count; BigInteger pro = ((time * 60)*60) + (count * sec); if(hand >= pro) { break; } } Console.WriteLine(count); } }