object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val n = sc.nextInt()
  val a = List.fill(n)(sc.nextInt())
  val count = a.groupBy(identity).view.mapValues(_.length)
  var ans = 0
  for ((k, v) <- count) {
    if (k <= v) {
      ans += v - k
    } else {
      ans += v
    }
  }
  println(ans)
}
