A, B, C = map(int, input().split()) hi = 10**18 lo = -1 while hi - lo > 1: mid = (hi + lo) // 2 if C * 3600 + B * mid <= A * 60 * mid: hi = mid else: lo = mid print(hi if hi != 10**18 else -1)