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