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

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

  int[int] mp;
  for (int i = 0; i < N; i++) {
    mp[a[i]]++;
  }

  int ans;
  foreach (m; mp.byKey) {
    if (m <= mp[m]) {
      ans += mp[m] - m;
    }
    else {
      ans += mp[m];
    }
  }

  writeln(ans);
}
