#include <iostream>
#include <map>
using namespace std;

int n;
map<int, int> d;

int main() {
	int i;
	
	cin >> n;
	for (i = 0; i < n; i++) {
		int a; cin >> a;
		d[a]++;
	}
	
	int ans = 0;
	for (map<int, int>::iterator it = d.begin(); it != d.end(); it++) {
		int num = it->first;
		int cnt = it->second;
		if (cnt < num) ans += cnt;
		else ans += cnt - num;
	}
	cout << ans << endl;
	return 0;
}