import sys

import collections

input=sys.stdin.readline



n=int(eval(input()))

l=list(map(int,input().split()))

li=collections.Counter(l)

#print(li)

a=0

for k,v in list(li.items()):

    if k>v:

        a+=v

    else:

        a+=v-k

print(a)
import sys

import collections

input=sys.stdin.readline



n=int(eval(input()))

l=list(map(int,input().split()))

s=collections.Counter(l)

#print(s)

a=0

for k,v in list(s.items()):

    if k>v:

        a+=v

    else:

        a+=v-k

print(a)
import sys
import collections

input = sys.stdin.readline
n = int(eval(input()))
l = list(map(int, input().split()))
li = collections.Counter(l)
# print(li)
a = 0
for k, v in list(li.items()):
    if k > v:
        a += v
    else:
        a += v - k
print(a)

import sys
import collections

input = sys.stdin.readline
n = int(eval(input()))
l = list(map(int, input().split()))
s = collections.Counter(l)
# print(s)
a = 0
for k, v in list(s.items()):
    if k > v:
        a += v
    else:
        a += v - k
print(a)

-li = collections.Counter(l) -# print(li) +s = collections.Counter(l) +# print(s) -for k, v in list(li.items()): +for k, v in list(s.items()):