#include <bits/stdc++.h>
int N;
int a[100000 + 10];
using namespace std;
int main () {
  cin >> N;
  int ret = 0;
  for(int i = 0; i < N; ++i) {
    int x;
    cin >> x;
    if (x > N) ret++;
    else {
      a[x]++;
    }
  }

  for(int i = 0; i <= N; ++i) {
    if (a[i] < i) ret += a[i];
    else if (a[i] > i) ret += a[i] - i;
  }
  cout << ret << endl;
}