import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines A,B,C = map(int,read().split()) A *= 60 C *= 3600 if B >= A: print(-1) exit() def test(x): # 書く return A*x >= C + B*x left = 0 right = 10**20 while left + 1 < right: x = (left+right) // 2 if test(x): right = x else: left = x print(right)