import std.stdio,
       std.string,
       std.conv,
       std.algorithm;

void main() {
  int N = readln.chomp.to!(int);
  int[] a = readln.chomp.split.to!(int[]);

  sort(a);
  int cnt = 1, now = a[0];
  int ans;
  for (int i = 1; i < N; i++) {
    if (now == a[i]) {
      cnt++;
    }
    else {
      if (now <= cnt) {
        ans += cnt - now;
      }
      else {
        ans += cnt;
      }
      now = a[i];
      cnt = 1;
    }
  }
  if (now <= cnt) {
    ans += cnt - now;
  }
  else {
    ans += cnt;
  }

  writeln(ans);
}
