console.log((args=>{
  const [[N],a] = args.trim().split('\n').map(r=>r.split(' ').map(v=>v|0));
  const c = new Map();
  let count = 0;
  for ( let i = 0; i < N; i++ ) {
    if ( a[i] > N ) count++;
    else c.set(a[i], 1+(c.get(a[i])|0) );
  }
  for ( const [i,v] of c ) {
    if ( i < v ) count += v-i;
    else if ( v < i ) count += v;
  }
  return `${count}`;
})(require('fs').readFileSync('/dev/stdin', 'utf8')));
