eval(input())

from collections import *

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

a=0

for k,v in list(c.items()):

  if k<v: a+=v-k

  if k>v: a+=v

print(a)
eval(input())

from collections import *

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

print((sum(v-k*(k<=v) for k,v in list(c.items()))))
eval(input())
from collections import *

c = Counter(list(map(int, input().split())))
a = 0
for k, v in list(c.items()):
    if k < v:
        a += v - k
    if k > v:
        a += v
print(a)

eval(input())
from collections import *

c = Counter(list(map(int, input().split())))
print((sum(v - k * (k <= v) for k, v in list(c.items()))))

-a = 0 -for k, v in list(c.items()): -    if k < v: -        a += v - k -    if k > v: -        a += v -print(a) +print((sum(v - k * (k <= v) for k, v in list(c.items()))))