n = gets.to_i
a = gets.chomp.split.map(&:to_i)
b = gets.chomp.split.map(&:to_i)

pls = []
mns = 0
res = 0
n.times do |i|
  if b[i] > a[i]
    res += 1
    mns += b[i] - a[i]
  elsif b[i] < a[i]
    pls << i
  end
end
  
pls.sort_by! {|i| (a[i] - b[i]) }
while mns > 0 && !pls.empty?
  i = pls.pop
  mns -= a[i] - b[i]
  res += 1
end

puts (mns > 0)? "-1" : res