from collections import Counter
n,*a = [int(x) for x in open(0).read().split()]
c=Counter(a)
ans=0
for k,v in c.items():
    if k==v:
        continue
    if k<v:
        ans+=v-k
    else:
        ans+=v
print(ans)
