import scala.io.StdIn._

object Main extends App {

  val n = readInt()
  val a = readLine().split(" ").map(_.toInt)

  def solve() = {
    val numAndCntMap = a.groupBy(identity).mapValues(_.length)
    numAndCntMap.foldLeft(0) { case (acc, (num, cnt)) =>
      if(num <= cnt) acc + (cnt - num)
      else acc + cnt
    }
  }

  println(solve())

}

