N = gets.to_i
A = gets.split.map(&:to_i)
B = gets.split.map(&:to_i)

stock = A.zip(B).map { |a, b| a - b }.sort

diff = 0
ans = 0

N.times do |i|
  if A[i] < B[i]
    ans += 1
    diff += A[i] - B[i]
  end

  while diff < 0 && !stock.empty?
    diff += stock.pop
    ans += 1
  end
end

if diff < 0
  puts -1
else
  puts ans
end
