A, B, C = gets.split.map(&:to_i) if 60*A - B == 0 then puts(-1) end cross = C*3600 / (60*A - B) rem = C*3600 % (60*A - B) if cross >= 0 then if rem == 0 then p cross else p cross.floor + 1 end else p(-1) end