n = gets.to_i
as = gets.split.map(&:to_i)
bs = gets.split.map(&:to_i)

diff = Array.new(n) { |i| as[i] - bs[i] }

remains = diff.select { |i| i > 0 }.sort
requires = diff.select { |i| i < 0 }.sort

valid = true
changed = 0
charge = 0
while !(requires.empty?)
  req = -requires.pop
  # [req, requires].tapp
  changed += 1
  # remains.tapp
  while !(remains.empty?) && charge < req
    charge += remains.pop
    changed += 1
  end
  # [charge, remains].tapp
  if remains.empty? && charge < req
    valid = false
    break
  end
  charge -= req
end
puts(valid ? changed : -1)