from collections import Counter

n = int(eval(input()))

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



ans = 0

for x,y in list(a.items()):

    if x == y: continue

    if x < y: ans += y-x

    else: ans += y

print(ans)
from collections import Counter

n = int(eval(input()))

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

ans = 0

for x,y in list(a.items()):

    if y<x: ans += y

    else:ans += y-x

print(ans)
from collections import Counter

n = int(eval(input()))
a = Counter(list(map(int, input().split())))
ans = 0
for x, y in list(a.items()):
    if x == y:
        continue
    if x < y:
        ans += y - x
    else:
        ans += y
print(ans)

from collections import Counter

n = int(eval(input()))
a = Counter(list(map(int, input().split())))
ans = 0
for x, y in list(a.items()):
    if y < x:
        ans += y
    else:
        ans += y - x
print(ans)

-    if x == y: -        continue -    if x < y: +    if y < x: +        ans += y +    else: -    else: -        ans += y