fun main(arg: Array<String>) {
    val N = nextInt()
    val A = listOfInt()
    val M = mutableMapOf<Int, Int>()
    A.forEach { M[it] = M.getOrElse(it, { 0 }) + 1 }
    var ans = 0
    for ((k, v) in M) if (v != k) if (v - k > 0) ans += Math.min(v - k, v) else ans += v
    println(ans)
}

fun next() = readLine()!!
fun nextInt() = next().toInt()
fun listOfString() = next().split(" ")
fun listOfInt() = listOfString().map { Integer.parseInt(it) }
