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

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

rest = bsum - asum
goods.sort_by{|a,b|b-a}

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

p count

