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

if a.inject(&:+) < b.inject(&:+)
  puts -1
  exit(0)
end

d = a.zip(b).map{|a,b| a-b}
dp = d.select(&:positive?).sort.reverse
dn = -d.select(&:negative?).inject(0,&:+)

if dn == 0
  puts 0
  exit(0)
end

(dp.size-1).times.each do |i|
  dp[i+1] += dp[i]
end

puts (dp.each_with_index.to_a.bsearch{|x, i| dn <= x} || [0,-1])[1] + d.select(&:negative?).size+1
