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

#=======================
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 sort(n,a,b)
  ab =[]
  for i in (0..n-1)
    if a[i] - b[i] >0
      ab.push([a[i],b[i]])
  end
  end
  ab.sort_by!{|ary| -(ary[0]-ary[1])}
  return ab
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]
  answer = j
  ###
  ###
  ab = sort(n,a,b)
  k=0
  while deficit < 0
    if k == ab.size
      return -1
    end
  dictance = ab[k][0] - ab[k][1]
  deficit = deficit + dictance
  answer +=1
  k +=1
  end

return answer


end
puts checker(n,aa,bb)
