N = int(eval(input()))

S = list(int(i) for i in input().split())  

dict = {}

count = 0



for i in range(N):

    if S[i] not in dict:

        dict[S[i]] = 1

    else:

        dict[S[i]] += 1



for key, value in list(dict.items()):

    if key < value:

        count += (value-key)

    elif key > value:

        count += value



print(count)
from collections import Counter as C



N = int(eval(input()))

S = list(int(i) for i in input().split())

count = 0



for key, value in list(C(S).items()):

    if key < value:

        count += (value-key)

    elif key > value:

        count += value



print(count)
N = int(eval(input()))
S = list(int(i) for i in input().split())
dict = {}
count = 0
for i in range(N):
    if S[i] not in dict:
        dict[S[i]] = 1
    else:
        dict[S[i]] += 1
for key, value in list(dict.items()):
    if key < value:
        count += value - key
    elif key > value:
        count += value
print(count)

from collections import Counter as C

N = int(eval(input()))
S = list(int(i) for i in input().split())
count = 0
for key, value in list(C(S).items()):
    if key < value:
        count += value - key
    elif key > value:
        count += value
print(count)

+from collections import Counter as C + -dict = {} -for i in range(N): -    if S[i] not in dict: -        dict[S[i]] = 1 -    else: -        dict[S[i]] += 1 -for key, value in list(dict.items()): +for key, value in list(C(S).items()):