//#define __popcnt __builtin_popcount
#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
#include <unordered_map>
#include <unordered_set>
using namespace std;
#define sz(a) ((int)(a).size())
#define all(n) (n).begin(),(n).end()
#define EPS 1e-6
#define OO 1e9
#define PI acos(-1.0)
#define ll long long
#define endl "\n"
#define scl(x) scanf("%lld",&x)
#define sc(x)  scanf("%d",&x)
#define sch(x)  scanf("%c",&x)
#define scs(x)  scanf("%s",x)
#define prl(x) printf("%lld",x)
#define pr(x)  printf("%d",x)
#define prs(x) printf("%s",x)
#define prline printf("\n");

void file(){
#ifndef ONLINE_JUDGE
	freopen("a_input.txt", "r", stdin);
	freopen("a_output.txt", "w", stdout);
#endif
}
void fast()
{
	std::ios_base::sync_with_stdio(0);
	cin.tie(NULL);
	cout.tie(NULL);
}
ll gcd(ll a, ll b) { return !b ? a : gcd(b, a % b); }
ll lcm(ll a, ll b) { return (a / gcd(a, b)) * b; }
int dx[] = { -1, 0, 0, 1, 1, 1, -1, -1 };
int dy[] = { 0, 1, -1, 0, 1, -1, 1, -1 };
//280,000
//1400

int main()
{
	/***  بسم الله الرحمن ا لرحيم   ***/
	file();
	fast();
	int n;
	cin >> n;
	map<int, int> mp;
	while (n--){
		int a;
		cin >> a;
		mp[a]++;
	}
	int sum = 0;
	for (auto i:mp)
	if (i.first < i.second)sum += i.second - i.first;
	else if (i.first>i.second)sum += i.second;
	cout << sum;
}