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

int main()
{
	map<int, int> cnt;
	int t;
	cin >> t;
	for (int i = 0; i < t; i++)
	{
		int m;
		cin >> m;
		cnt[m]++;
	}
	int ans = 0;

	for (auto u : cnt)
	{
		if (u.second >= u.first)
			ans += (u.second - u.first);
		else
			ans += u.second;
	}
	cout << ans << endl;

	return 0;
}
//8
//2 7 1 8 2 8 1 8