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