n=gets.to_i
a = gets.chomp.split(" ").map!(&:to_i)
b = gets.chomp.split(" ").map!(&:to_i)
ex=[]
lack=0
ans = 0

n.times do |i|
  t=a[i]-b[i]
  ex << t if t>0
  if t<0
    lack+= -t
    ans+=1
  end
end
ex.sort!.reverse!
ex.each do |v|
  break if lack<=0
  lack-=v
  ans+=1
end
if lack<=0
  puts ans+cnt
else
  puts -1
end