fun main(args: Array<String>) {
  val n = readLine()!!.toInt()
  val a = readLine()!!.split(" ").map { it.toInt() }
  val g = a.groupBy { it }
  val cnt = g.map {
    val size = it.value.size
    return@map if (it.key <= size) size - it.key else size
  }.sum()
  println(cnt)
}
