import java.util.*

fun main(args: Array<String>) {
    val pw = java.io.PrintWriter(System.out)
    Problem.solve(Scanner(System.`in`), pw)
    pw.flush()
}

object Problem {
    fun solve(sc: Scanner, pw: java.io.PrintWriter) {
        val N = sc.next().toInt()
        val A = IntArray(N) { sc.next().toInt() }
        val a = mutableMapOf<Int, Int>()
        A.forEach {
            a[it] = (a[it] ?: 0) + 1
        }
        //dprint(a)
        var ans = 0L
        a.forEach {
            ans += if (it.key <= it.value) it.value - it.key else it.value
        }
        pw.println(ans)
    }
}
