#include <cstdio>
#include <cstring>
using namespace std;
int n,p,ans=0;
int f[100001];
int main(){
	memset(f,0,sizeof(f));
	scanf("%d",&n);
	for(int i=1;i<=n;i++){
		scanf("%d",&p);
		if(p>100000)ans++;
		else f[p]++;
	}
	for(int i=1;i<100001;i++){
		if(f[i]<i)ans+=f[i];
		else if(f[i]>i)ans+=f[i]-i;
	}
	printf("%d",ans);
	return 0;
}