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

cnt = 0

aa = a.sort
bb = b.sort

for i in 0..n-1 do
  if bb[i] - aa[i] > 0
    cnt += 1
  end
end

if a.inject(:+) < b.inject(:+)
  puts -1
else
  puts cnt
end