import collections as c

a=c.Counter(list(map(int,open(0).read().split()[1:])))

print((sum([[v-k,v][k>v] for k,v in list(a.items())])))
from collections import*;n,*a=list(map(int,open(0).read().split()));print((sum(v-k*(v>=k)for k,v in list(Counter(a).items()))))
import collections as c

a = c.Counter(list(map(int, open(0).read().split()[1:])))
print((sum([[v - k, v][k > v] for k, v in list(a.items())])))

from collections import *

n, *a = list(map(int, open(0).read().split()))
print((sum(v - k * (v >= k) for k, v in list(Counter(a).items()))))

-import collections as c +from collections import * -a = c.Counter(list(map(int, open(0).read().split()[1:]))) -print((sum([[v - k, v][k > v] for k, v in list(a.items())]))) +n, *a = list(map(int, open(0).read().split())) +print((sum(v - k * (v >= k) for k, v in list(Counter(a).items()))))