#include <iostream>
#include <map>

using namespace std;

int main(void) {
  int n;
  cin >> n;
  int a[n];
  map <int, int> mp;
  for(int i = 0; i < n; i++) {
    cin >> a[i];
    mp[a[i]]++;
  }

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

  cout << count << endl;
}