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

count = 0
goods = []
rest = 0
n.times do |i|
  a = as[i]
  b = bs[i]
  if a < b
    count += 1
    rest += b - a
  else
    goods << [a,b]
  end
end

goods.sort_by{|a,b|b-a}

i = 0
while i < goods.length
  break if rest <= 0
  a,b = goods[i]
  rest -= a-b
  count += 1
  i += 1
end

if rest <= 0
  p count
else
  p -1
end