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

d = Array.new(n,0)
n.times{|i| d[i] = a[i] - b[i]}
d.sort!

i = 0
j = n - 1
c = 0

while d[i] < 0
    if d[i] + c >= 0
        c += d[i]
        i += 1
    elsif d[j] < 0
        puts -1
        exit
    else
        c += d[j]
        j -= 1
    end
end

puts i + n - j - 1