data_set = readlines
as = data_set[1].split.map(&:to_i)
bs = data_set[2].split.map(&:to_i)
ds = as.zip(bs).map{|a, b| a - b}

if ds.reduce(:+) < 0
  puts -1
  exit
end

lack_list = ds.select{|x| x < 0}
lack = lack_list.reduce(:+)

unless lack
  puts 0
  exit
end

exceed_list = ds.select{|x| x > 0}.sort.reverse

c = 1
(0..exceed_list.size).each do |i|
  sum = exceed_list[0..i].reduce(:+)
  break if sum + lack >= 0
  c += 1
end

puts c + lack_list.size
