#include<iostream>
#include<map>
using namespace std;

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

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

  int count = 0;
  for(auto p: mp) {
    int x = p.first;
		int n = p.second;
		if (n < x) count += n;
		else count += n - x;
  }

  cout << count << '\n';

  return 0;
}
