#include <iostream>
using namespace std;

const int MAXN = 1e5 + 10;
int cnt[MAXN], n, ans;

int main() {
	cin >> n;
	for (int i = 0; i < n; i++) {
		int a;
		cin >> a;
		if (a > 1e5)
			ans++;
		else
			cnt[a]++;
	}
	for (int i = 0; i < MAXN; i++)
		if (cnt[i] < i)
			ans += cnt[i];
		else
			ans += cnt[i] - i;
	cout << ans;
}