// 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.9206351131470671x):
//https://vjudge.net/contest/331523#problem/D

/*

* Author : MaxSally

*/

/********   All Required Header Files ********/

#include<bits/stdc++.h>

using namespace std;

/*******  All Required define Pre-Processors and typedef Constants *******/

#define SCD(t) scanf("%d",&t)

#define SCLD(t) scanf("%ld",&t)

#define SCLLD(t) scanf("%lld",&t)

#define SCC(t) scanf("%c",&t)

#define SCS(t) scanf("%s",t)

#define SCF(t) scanf("%f",&t)

#define SCLF(t) scanf("%lf",&t)

#define mem(a, b) memset(a, (b), sizeof(a))

#define rep(i, j, k) for (int i = j ; i <= k ; ++i)

#define rrep(i, j, k) for (int i = j; i >= k; --i)

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

#define rall(cont) cont.end(), cont.begin()

#define foreach(i, a) for(auto i: a)

#define forEach(it, l) for (auto it = l.begin(); it != l.end(); it++)

#define in(A, B, C) assert( B <= A && A <= C)

#define mp make_pair

#define pb push_back

#define inf (int) (1e9 + 7)

#define epsi 1e-9

#define PI 3.1415926535897932384626433832795

#define mod 1000000007

#define read(type) readInt<type>()

#define io ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);

#define ll long long int

#define left tuyiuoi

#define right fgjhk

#define ss second

#define ff first

#define debug(a) cout << #a << ": " << a << endl

#define debuga1(a, l, r) rep(i, l, r) cout << a[i] << " "; cout << endl

#define Flag(n) cout << "here " << n << endl

const double pi=acos(-1.0);

typedef pair<int, int> pii;

typedef vector<int> vi;

typedef vector<ll> vl;

typedef vector<vl> vll;

typedef pair<ll, ll> pll;

typedef vector<string> vs;

typedef vector<pii> vii;

typedef vector<pll> vpll;

typedef vector<vi> vvi;

typedef map<int,int> MPII;

typedef set<int> SETI;

typedef multiset<int> MSETI;

typedef long int int32;

typedef unsigned long int uint32;

typedef long long int int64;

typedef unsigned long long int  uint64;



const int N = 100005;

MPII m;



int main(){

    io;

    //freopen("input.txt", "r", stdin);

    int n; cin >> n;

    rep(i, 1, n){

        int x; cin >> x;

        if(m.find(x) == m.end()){

            m.insert(mp(x, 1));

        }else{

            m[x]++;

        }

    }

    int total = 0;

    foreach(a, m){

        if(a.ff <= a.ss){

            total += a.ss - a.ff;

        }else{

            total += a.ss;

        }

    }

    cout << total;

    return 0;

}