#include <algorithm>
#include <cstdio>
const int N = 100050;
int A[N];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%d", &A[i]);
  std::sort(A, A + n);
  int ans = 0;
  for (int i = 0; i < n;) {
    int b = i, x = A[i];
    while (A[++i] == x);
    if (i - b >= x) ans += i - b - x;
    else ans += i - b;
  }
  printf("%d\n", ans);
  return 0;
}