'use strict'

function main(s) {

  s = s.split('\n');

  const N = Number(s[0]);
  const a = s[1].split(' ').map(n => Number(n));

  const bucket = [...Array(100001)].fill(0);

  let ans = 0;

  for (let i = 0; i < N; i++) {
    if (a[i] > 100000) {
      ans += 1;
    } else {
      bucket[a[i]] += 1;
    }
  }

  for (let i = 0; i < bucket.length; i++) {
    if (i > bucket[i]) ans += bucket[i];
    if (i < bucket[i]) ans += bucket[i] - i;
  }

  console.log(ans);
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));
