n=int(eval(input()))

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

set_a=set(a)

import collections

count=0

data=collections.Counter(a)

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

    if i<j:

        count+=j-i

    elif j<i:

        count+=j

print(count)
n=int(eval(input()))

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

from collections import Counter

data=Counter(a)

ans=0

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

    if i<j:

        ans+=j-i

    elif j<i:

        ans+=j

print(ans)

n = int(eval(input()))
a = list(map(int, input().split()))
set_a = set(a)
import collections

count = 0
data = collections.Counter(a)
for i, j in list(data.items()):
    if i < j:
        count += j - i
    elif j < i:
        count += j
print(count)

n = int(eval(input()))
a = list(map(int, input().split()))
from collections import Counter

data = Counter(a)
ans = 0
for i, j in list(data.items()):
    if i < j:
        ans += j - i
    elif j < i:
        ans += j
print(ans)

-set_a = set(a) -import collections +from collections import Counter -count = 0 -data = collections.Counter(a) +data = Counter(a) +ans = 0 -        count += j - i +        ans += j - i -        count += j -print(count) +        ans += j +print(ans)