#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
#include <map>
using namespace std;

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

	int ans = 0;
	for (auto a : m) {
		if (a.first > a.second)ans += a.second;
		else ans += a.second - a.first;
	}

	cout << ans << endl;
	
	return 0;
}