
fun main(arr:Array<String>) {
    val n = readLine()!!.toInt()
    val numbers = readLine()!!.split(" ").map { it.toLong() }
    val numberCount = mutableMapOf<Long, Long>()
    for(i in numbers) {
        numberCount[i] = (numberCount[i]?:0) + 1
    }
    var ans = 0L
    for(num in numberCount.keys) {
        numberCount[num]?.let {
            if(it > num) {
                ans += it - num
            } else if(it < num) {
                ans += it
            }
        }
    }
    println(ans)
}

