def NumDeficits(dist, desired_dist):
  """Return the number of kinds that are too small.

  Args:
    dist: array sorted in reverse order
    desired_dist: ditto
  """
  #need = set(desired_dist)
  n = len(desired_dist)
  num_deficits = 0
  for i in range(n):
    if dist[i] < desired_dist[i]:
      num_deficits += 1
  return num_deficits