n=gets.to_i
aa = gets.chomp.split(" ").map{|a|a.to_i}
bb = gets.chomp.split(" ").map{|a|a.to_i}

#========================
def maxindex(n,a,b)
  max = 0
for i in(0..n-1)
  if (a[i] - b[i]) > max
    max = a[i] - b[i]
    maxindex =  i
  end
end
  return [maxindex,max]
end
#=======================
def counttotaldeficit(n,a,b)
  deficit = 0
  j = 0
  for i in(0..n-1)
    if (a[i] - b[i]) <0
      j +=1
        deficit += a[i] - b[i]
    end
  end
  return [deficit,j]
end
#========================
def checker(n,a,b)
  answer = 0
  a.each_with_index{|item,index|
  if item < b[index]
    answer = -1
    break
  else
  end
  }
  if answer == 0
    return answer
  end
  array = counttotaldeficit(n,a,b)
  deficit = array[0]
  j = array[1]
  k = 0
  answer = j

  while deficit < 0
    array = maxindex(n-k,a,b)
  idx = array[0]
  dictance = array[1]
  if dictance == 0
    return -1
  else
  deficit = deficit + dictance
  answer +=1
  k +=1
  a.delete(idx)
  b.delete(idx)
  end
end

return answer


end

puts checker(n,aa,bb)
