#include <bits/stdc++.h>
using namespace std;

map<int,int> m;
vector<int> v;
int n,x,i,ans;

int main()
{
	scanf("%d",&n);
	for(i=1;i<=n;i++)
	{
		scanf("%d",&x);
		if(m[x]==0) v.push_back(x);
		m[x]++;
	}
	
	for(i=0;i<v.size();i++) 
	  if(v[i]>m[v[i]]) ans+=m[v[i]];
	  else if(v[i]<m[v[i]]) ans+=m[v[i]]-v[i];
	  
	printf("%d\n",ans);
	return 0;
}