import scala.collection.mutable.HashMap
import scala.collection.immutable.List

object Main {
  def main(args: Array[String]) = {
    val sc = new java.util.Scanner(System.in)
    val n = sc.nextInt
    val list = List.fill(n)(sc.nextInt)
    var hist = new HashMap[Int, Int]

    for (x <- list)
      hist(x) = hist.getOrElse(x, 0) + 1

    var ans = 0
    for (x <- hist.keys) {
      if (x < hist(x))
        ans += hist(x) - x
      else if (x > hist(x))
        ans += hist(x)
    }

    println(ans)
  }
}
