// Slower C++ solution:


/// 28-01-2018

/// MD:NUR ALAM

/// Eastern University of Bangladesh



#include "bits/stdc++.h"



#define sz(x) ((int)(x).size())

#define all(x) (x).begin(), (x).end()

#define rep(i, n) for (int i = 0; i < (n); ++i)

#define repp(i, a, b) for (int i = (a); i < (b); ++i)

#define fo(i, a, b) for (int i = (a); i <(b); ++i)

#define fors(i, s) for (int i = 0; s[i]; ++i)

#define rs(x) scanf("%s", (x))

#define mp make_pair

#define pb push_back

#define mso(X) memset((X), 0, sizeof((X)))

#define MS1(X) memset((X), -1, sizeof((X)))

#define len(X) strlen(x)

#define nur 100000

using namespace std;



typedef long long ll;

typedef uint64_t ull;

typedef long double lu;

typedef pair<int,int> pii;

typedef vector<int> vi;

typedef vector<pii> vpll;

typedef pair<int,int> Pll;

typedef map<string,int>msi;

typedef set<int>se;



template<class t> void _r(t &x) { cin >> x; }

void _r(int &x) { scanf("%d", &x); }

void _r(int64_t &x) { scanf("%lld", &x); }

void _r(double &x) { scanf("%lf", &x); }

void _r(char &x) { scanf(" %c", &x); }

void _r(char *x) { scanf("%s", x); }

void r() {}

template<class t, class... u> void r(t &head, u &... tail) { _r(head); r(tail...); }

template<class t> void _w(const t &x) { cout << x; }

void _w(const int &x) { printf("%d", x); }

void _w(const int64_t &x) { printf("%lld", x); }

void _w(const double &x) { printf("%.16f", x); }

void _w(const char &x) { putchar(x); }

void _w(const char *x) { printf("%s", x); }

template<class t,class u> void _w(const pair<t,u> &x) {_w(x.f); putchar(' '); _w(x.s);}

void w() {}

template<class t, class... u> void w(const t &head, const u &... tail) { _w(head); putchar(sizeof...(tail) ? ' ' : '\n'); w(tail...); }

template<class t, class... u> void debug(const t &head, const u &... tail) {

#ifdef HOME

#endif

}



///------------------------------------------------------------------------------------------------------------------------------------





int main()

{

    ll n,c=0,check[100005]={0};

    r(n);

    ll ar[n];



    rep(i,n){

        r(ar[i]);



        if(ar[i]>nur)

        {

            c++;

        }

        else if(ar[i]<=nur)

        {

            check[ar[i]]++;

        }

    }



    rep(i,nur){

        if(check[i]>i)

        {

            c = c+(check[i]-i);

        }

        else if(check[i]<i)

        {

            c = c+check[i];

        }

    }



    w(c);

}


// Faster C++ solution for the same problem (measured speedup: 1.946677823239103x):
#include<functional>

#include<algorithm>

#include<iostream>

#include<iomanip>

#include<cstring>

#include<cstdlib>

#include<utility>

#include<string>

#include<cmath>

#include<cstdio>

#include<vector>

#include<bitset>

#include<ctime>

#include<queue>

#include<deque>

#include<stack>

#include<map>

#include<set>

using namespace std;

const int inf=2147483647,dx[]={-1,0,1,0},dy[]={0,-1,0,1};// ÉÏ ×ó ÏÂ ÓÒ

const int N=100005,M=1000005,mod=1000000007;

const long long llinf=9223372036854775807ll;

//int & long long

int n,a,ans;

map<int,int> mp;

int main(){

	scanf("%d",&n);

	for(int i=1;i<=n;i++)

		scanf("%d",&a),mp[a]++;

	for(map<int,int>::iterator it=mp.begin();it!=mp.end();it++)

		if(it->second!=it->first)

		{

			if(it->second<it->first)

				ans+=it->second;

			else

				ans+=it->second-it->first;

		}

	cout<<ans;

	return 0;

}