import collections



num = int(eval(input()))

val = [int(x) for x in input().split()]



cnt = collections.Counter(val)

res = 0

for x in cnt:

    if cnt[x] > x:

        res += cnt[x] - x

    elif cnt[x] < x:

        res += cnt[x]



print(res)
import collections



n = int(eval(input()))

array = [int(x) for x in input().split()]

_dict = collections.Counter(array)



res = 0

for i, j in list(_dict.items()):

    if i != j:

        if i > j:

            res += j

        else:

            res += abs(i-j)

print(res)
import collections

num = int(eval(input()))
val = [int(x) for x in input().split()]
cnt = collections.Counter(val)
res = 0
for x in cnt:
    if cnt[x] > x:
        res += cnt[x] - x
    elif cnt[x] < x:
        res += cnt[x]
print(res)

import collections

n = int(eval(input()))
array = [int(x) for x in input().split()]
_dict = collections.Counter(array)
res = 0
for i, j in list(_dict.items()):
    if i != j:
        if i > j:
            res += j
        else:
            res += abs(i - j)
print(res)

-num = int(eval(input())) -val = [int(x) for x in input().split()] -cnt = collections.Counter(val) +n = int(eval(input())) +array = [int(x) for x in input().split()] +_dict = collections.Counter(array) -for x in cnt: -    if cnt[x] > x: -        res += cnt[x] - x -    elif cnt[x] < x: -        res += cnt[x] +for i, j in list(_dict.items()): +    if i != j: +        if i > j: +            res += j +        else: +            res += abs(i - j)