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

const int N = 1e5 + 5;

int n;
int cnt[N];

int main() {
	ios_base::sync_with_stdio(false);
	cin >> n;
	int res = 0;
	for (int i = 1; i <= n; ++i) {
		int x; cin >> x;
		if (x > n) res++;
		else cnt[x]++;
	}
	for (int i = 1; i < N; ++i) if (cnt[i]) {
		if (cnt[i] >= i) res += cnt[i] - i;
		else res += cnt[i];
	}
	cout << res << '\n';
}