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())))

cnt = 0

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

    if x==y: continue

    if x>y: cnt += y

    else: cnt += y-x

print(cnt)
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())))
cnt = 0
for x, y in list(a.items()):
    if x == y:
        continue
    if x > y:
        cnt += y
    else:
        cnt += y - x
print(cnt)

-ans = 0 +cnt = 0 -    if y < x: -        ans += y +    if x == y: +        continue +    if x > y: +        cnt += y -        ans += y - x -print(ans) +        cnt += y - x +print(cnt)