let v=readLine()!.split(separator:" ").map{Int($0)!},a=v[0]*60-v[1],c=v[2]*3600 print(a>0 ?(c+a-1)/a:-1)