from collections import Counter



N = int(eval(input()))

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



ca = Counter(a)



ans = 0

for num, freq in list(ca.items()):

    ans += freq- num if freq >= num else freq



print(ans)
from collections import Counter



N = int(eval(input()))

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



ans = 0

for num, freq in list(Counter(a).items()):

    ans += freq- num if freq >= num else freq



print(ans)
from collections import Counter

N = int(eval(input()))
a = list(map(int, input().split()))
ca = Counter(a)
ans = 0
for num, freq in list(ca.items()):
    ans += freq - num if freq >= num else freq
print(ans)

from collections import Counter

N = int(eval(input()))
a = list(map(int, input().split()))
ans = 0
for num, freq in list(Counter(a).items()):
    ans += freq - num if freq >= num else freq
print(ans)

-ca = Counter(a) -for num, freq in list(ca.items()): +for num, freq in list(Counter(a).items()):