# frozen_string_literal: true

n = gets.to_i
a = gets.split.map(&:to_i)
b = gets.split.map(&:to_i)
count = 0
sum = 0
c = []
(0...n).each do |i|
  e = a[i] - b[i]
  if e.negative?
    count += 1
    sum += e
    e = 0
  end
  c.push e
end
c.sort.reverse.each do |d|
  break if sum >= 0

  sum += d
  count += 1
end
puts count > n ? '-1' : count
