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

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

if asum<bsum
  #むりくぼ
  p -1
  exit
end

dif = asum-bsum
w = []
n.times{|i|
  if a[i]>=b[i]
    w << a[i]-b[i]
  end
}

w.sort!
w.each{|t|
  dif-=t
  n-=1 if dif>=0
}

p n