n = gets.to_i
a = gets.split.map(&:to_i)
b = gets.split.map(&:to_i)
dif = a.zip(b).map{ |aa, bb| aa - bb }.sort.reverse
ans = 0
if i = dif.index{ |x| x < 0 }
  minus = dif[i..-1].reduce(:+)
  ans = -1
  (0...i).each do |j|
    minus += dif[j]
    if minus >= 0
      ans = n - i + 1 + j
      break
    end
  end
end

puts ans