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

void main() {
  int n = readln.chomp.to!int;
  int[int] chie;
  auto b = map!(x => x.to!int)(readln.chomp.split);
  int res = 0;
  foreach (x; b) {
    ++chie[x];
  }
  foreach (x, cnt; chie) {
    if (cnt >= x) {
      res += min(cnt - x, cnt);
    } else {
      res += cnt;
    }
  }
  writeln(res);
}
