#include <bits/stdc++.h>
using namespace std;

const int N = 1e5 + 100;

int n, num, ans, cnt[N];

int main() {
	ios::sync_with_stdio(false), cin.tie(0);
	cin >> n;
	while(n--) {
		cin >> num;
		if(num >= N)
			ans++;
		else
			cnt[num]++;
	}
	for (int i = 1; i < N; i++)
		if(cnt[i] < i)
			ans += cnt[i];
		else
			ans += cnt[i] - i;
	cout << ans;
	return 0;
}