let N = Int(readLine()!)!

var num: [Int: Int] = [:]
for a in readLine()!.split(separator: " ").map({Int($0)!}) {
    num[a] = (num[a] ?? 0) + 1
}

var res: Int = 0
for (a, aNum) in num {
    res += aNum < a ? aNum : aNum - a
}
print(res) // (๑•ૅㅁ•๑)