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

asum = a.inject(:+)
bsum = b.inject(:+)
diff = bsum - asum

if bsum > asum
  puts "-1"
else
  c = a.dup
  diff = c.map.with_index {|v, idx| v - b[idx] }
  pmax = diff.find_index(diff.max)

  loop do
    break if diff.all? {|item| item >= 0 }

    pmin = diff.find_index(diff.min)
    pmax = diff.find_index(diff.max) if diff[pmax] == 0

    if diff[pmax] + diff[pmin] < 0
      c[pmin] += diff[pmax]
      c[pmax] -= diff[pmax]
    else
      c[pmin] -= diff[pmin]
      c[pmax] += diff[pmin]
    end
    diff[pmin] = c[pmin] - b[pmin]
    diff[pmax] = c[pmax] - b[pmax]
  end

  diff = c.map.with_index {|v, idx| v - a[idx] }
  count = diff.select {|v| v != 0 }.size

  puts count
end