let N = Int(readLine()!)!
let a = readLine()!.characters.split(" ").map{Int(String($0))!}
var A = [Int : Int]()
var ans = 0
for i in a {
    if let _ = A[i] {
        A[i]! += 1
    } else {
        A[i] = 1
    }
}
for (i, j) in A {
    if i > j {
        ans += j
    } else {
        ans += j - i
    }
}
print(ans)