A, B, C = gets.split.map(&:to_i) if 60 * A - B == 0 puts 0 elsif 60 * A < B puts -1 else puts Rational(C * 3600, 60 * A - B).ceil end