n = gets.chomp.to_i
a_ary = gets.chomp.split(" ").map(&:to_i)
b_ary = gets.chomp.split(" ").map(&:to_i)

if a_ary.inject(:+) < b_ary.inject(:+)
  puts -1
  exit
end

dif = []
n.times do |i|
  dif << a_ary[i] - b_ary[i]
end

dif = dif.sort
idx = dif.index{ |i| i >= 0 }
if idx == 0
  puts 0
else
  sm = dif[0..(idx-1)].inject(:+)
  c = 1
  sum = 0
  sz = dif.size
  (sz - idx).times do |i|
    sum += dif[sz-i-1]
    if sum + sm >= 0
      c += i
      break
    end
  end
  puts idx+c
end