#include <bits/stdc++.h>
using namespace std;
 
int main() {
int n;
scanf("%d", &n);
int arr[n];
int ct[n+1];
memset(ct,0,sizeof(ct));
int ans=0;
for (int i=0;i<n;i++) {
scanf("%d", &arr[i]);
if (arr[i]>n) ans+=1;
else ct[arr[i]]++;
}
for (int i=0;i<=n;i++) {
if (ct[i]>=i) ans+=ct[i]-i;
else ans+=ct[i];
}
printf("%d\n", ans);
}