N = STDIN.gets.to_i

An = STDIN.gets.split.map(&:to_i)
Bn = STDIN.gets.split.map(&:to_i)

Pair = Struct.new(:a, :b, :dirty, :diff)

zipped = An.zip(Bn).map do |array|
  Pair.new(array[0], array[1], false, array[0] - array[1])
end

grouped = zipped.group_by {|pair| pair.a >= pair.b }

satisfied = grouped[true].sort_by {|pair| -(pair.a - pair.b)}
not_satisfied = grouped[false]

# p satisfied, not_satisfied

if not_satisfied.nil?
  puts 0
else
  shortage = not_satisfied.inject(0) {|sum, pair| sum + pair.diff}

  # p shortage

  num = 0

  satisfied.each do |pair|
    shortage += pair.diff
    pair.dirty = true
    num += 1
    if shortage>= 0
      break;
    end
  end

  if shortage < 0
    puts -1
  else
    puts not_satisfied.size + num
  end
end
