from collections import Counter

N = int(eval(input()))

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

CA = Counter(A)

ans = 0

for x in CA:

    if CA[x] >= x:

        ans += CA[x] - x

    else:

        ans += CA[x]

print(ans)
from collections import defaultdict

def main():

    N = int( eval(input()))

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

    d = defaultdict( int)

    for a in A:

        d[a] += 1

    ans = 0

    for key, value in list(d.items()):

        if key > value:

            ans += value

        elif key < value:

            ans += value - key

    print(ans)

if __name__ == '__main__':

    main()

from collections import Counter

N = int(eval(input()))
A = list(map(int, input().split()))
CA = Counter(A)
ans = 0
for x in CA:
    if CA[x] >= x:
        ans += CA[x] - x
    else:
        ans += CA[x]
print(ans)

from collections import defaultdict


def main():
    N = int(eval(input()))
    A = list(map(int, input().split()))
    d = defaultdict(int)
    for a in A:
        d[a] += 1
    ans = 0
    for key, value in list(d.items()):
        if key > value:
            ans += value
        elif key < value:
            ans += value - key
    print(ans)


if __name__ == "__main__":
    main()

-from collections import Counter +from collections import defaultdict -N = int(eval(input())) -A = list(map(int, input().split())) -CA = Counter(A) -ans = 0 -for x in CA: -    if CA[x] >= x: -        ans += CA[x] - x -    else: -        ans += CA[x] -print(ans) + +def main(): +    N = int(eval(input())) +    A = list(map(int, input().split())) +    d = defaultdict(int) +    for a in A: +        d[a] += 1 +    ans = 0 +    for key, value in list(d.items()): +        if key > value: +            ans += value +        elif key < value: +            ans += value - key +    print(ans) + + +if __name__ == "__main__": +    main()