A,B,C = map(int,input().split()) ok = 10**10 ng = 0 while ok - ng > 1: m = (ok+ng)//2 if m*A*60 >= m*B + C*3600: ok = m else: ng = m print(-1 if ok == 10**10 else ok)