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 A[i] == nil {
    A[i] = 0
  }
  A[i]! += 1
}
for (i, j) in A {
  if i > j {
    ans += j
  } else {
    ans += j - i
  }
}
print(ans)