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