#include <bits/stdc++.h>
using namespace std;
#define MAX 100002
int N, a[MAX];
map<int, int> mp;
int main(){
	scanf("%d", &N);
	for(int i = 0; i < N; i++){
		scanf("%d", a + i);
		mp[a[i]]++;
	}
	int ans = 0;
	for(auto &i : mp){
		int num = i.first;
		int cnt = i.second;
		if(num <= cnt)	ans += cnt - num;
		else ans += cnt;
	}
	printf("%d\n", ans);
	return 0;
}