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