from collections import Counter



n = int(eval(input()))

A = [int(i) for i in input().split()]



D = Counter(A)



res = 0

for i in list(D.items()):

    if i[0] < i[1]:

        res += i[1]-i[0]

    elif i[0] > i[1]:

        res += i[1]



print(res)
from collections import Counter



n = int(eval(input()))

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

D = Counter(A)

res = 0

for i,v in list(D.items()):

    if i > v:

        res += v

    elif i < v:

        res += v-i

print(res)

from collections import Counter

n = int(eval(input()))
A = [int(i) for i in input().split()]
D = Counter(A)
res = 0
for i in list(D.items()):
    if i[0] < i[1]:
        res += i[1] - i[0]
    elif i[0] > i[1]:
        res += i[1]
print(res)

from collections import Counter

n = int(eval(input()))
A = list(map(int, input().split()))
D = Counter(A)
res = 0
for i, v in list(D.items()):
    if i > v:
        res += v
    elif i < v:
        res += v - i
print(res)

-A = [int(i) for i in input().split()] +A = list(map(int, input().split())) -for i in list(D.items()): -    if i[0] < i[1]: -        res += i[1] - i[0] -    elif i[0] > i[1]: -        res += i[1] +for i, v in list(D.items()): +    if i > v: +        res += v +    elif i < v: +        res += v - i