from collections import Counter

def MI(): return list(map(int, input().split()))

def II(): return int(eval(input()))

def IS(): return eval(input())

def LI(): return list(map(int, input().split()))





n = II()

l = list(Counter(LI()).items())

ans = 0

for num in l:

    if num[0] < num[1]:

        ans += num[1]-num[0]

    elif num[0] > num[1]:

        ans += num[1]

    else:  # num[0] == num[1]

        pass

print(ans)

from collections import Counter

n=int(eval(input()))

ans=0

for i in list(Counter(list(map(int,input().split()))).items()):

    if i[0]<i[1]:

        ans+=i[1]-i[0]

    elif i[0]>i[1]:

        ans+=i[1]

print(ans)
from collections import Counter


def MI():
    return list(map(int, input().split()))


def II():
    return int(eval(input()))


def IS():
    return eval(input())


def LI():
    return list(map(int, input().split()))


n = II()
l = list(Counter(LI()).items())
ans = 0
for num in l:
    if num[0] < num[1]:
        ans += num[1] - num[0]
    elif num[0] > num[1]:
        ans += num[1]
    else:  # num[0] == num[1]
        pass
print(ans)

from collections import Counter

n = int(eval(input()))
ans = 0
for i in list(Counter(list(map(int, input().split()))).items()):
    if i[0] < i[1]:
        ans += i[1] - i[0]
    elif i[0] > i[1]:
        ans += i[1]
print(ans)

- -def MI(): -    return list(map(int, input().split())) - - -def II(): -    return int(eval(input())) - - -def IS(): -    return eval(input()) - - -def LI(): -    return list(map(int, input().split())) - - -n = II() -l = list(Counter(LI()).items()) +n = int(eval(input())) -for num in l: -    if num[0] < num[1]: -        ans += num[1] - num[0] -    elif num[0] > num[1]: -        ans += num[1] -    else:  # num[0] == num[1] -        pass +for i in list(Counter(list(map(int, input().split()))).items()): +    if i[0] < i[1]: +        ans += i[1] - i[0] +    elif i[0] > i[1]: +        ans += i[1]