a, b, c = map(int, input().split()) d = 60 * a - b if d <= 0: print(-1) else: print((3600 * c + d - 1) // d)