#include<cstdio>
#include<map>
using namespace std;
int n,ans;
map<int,int> m;
int main(){
	scanf("%d",&n);
	for(int i=1;i<=n;++i){
		int x; scanf("%d",&x); ++m[x];
	}
	for(map<int,int>::iterator it=m.begin();it!=m.end();++it){
		if(it->second>=it->first) ans+=it->second-it->first;
		else ans+=it->second;
	}
	printf("%d",ans);
	return 0;
}