/*
for:
Hussien , Ayman , Emad
Abanob , George , Genawy
Ka8eem , Mosta7il , Stawro
 
 ICPC DREAM
 */
#ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS
#endif
#include<bits/stdc++.h>
#include<unordered_map>
using namespace std;
#define ll long long
#define ld long double
#define ull unsigned ll 
#define endl '\n'
#define mk make_pair
const double PI = acos(-1.0);
void fast_in_out() {
	std::ios_base::sync_with_stdio(NULL);
	cin.tie(NULL); cout.tie(NULL);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}
int dx[] = { 0,0,-1,1,-1,1,-1,1,0 };
int dy[] = { -1,1,0,0,-1,-1,1,1,0 };
const ld eps = 1e-9;
const int mod = 998244353;
const int N = 2e5+10, M = 318;
int main() {
	fast_in_out();
	//cout << fixed << setprecision(6);
	// kolo ray7 , ya 5raby
	int n; cin >> n;
	map<int, int>mp;
	for (int i = 0; i < n; i++) {
		int x; cin >> x;
		mp[x]++;
	}
	int ans = 0;
	for (auto e : mp) {
		if (e.second == e.first)
			continue;
		if (e.second > e.first)
			ans += e.second -= e.first;
		if (e.second < e.first)
			ans += e.second;
	}
	cout << ans << endl;
	return 0;
}