import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

int readint() { return readln.chomp.to!int; }
int[] readints() { return readln.split.map!(to!int).array; }

int calc(int[] xs) {
    int[int] d;
    foreach (x; xs) d[x]++;

    int ans = 0;
    foreach (k, v; d) {
        if (k < v) ans += v - k;
        else if (k > v) ans += v;
    }
    return ans;
}

void main() {
    readint;
    auto xs = readints;
    writeln(calc(xs));
}