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