import java.util.*

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val n = sc.nextInt()

    val res = (1..n).map { sc.nextInt() }
            .groupBy { it }
            .map { if (it.key > it.value.count()) it.value.count() else it.value.count() - it.key }
            .sum()


    println(res)
}