from collections import Counter

n=int(eval(input()))

a=Counter(input().split())

ans=0

for i,j in list(a.items()):

  i=int(i)

  if i>j:

    ans+=j

  elif i<j:

    ans+=j-i

print(ans)
def main():

    n = int(eval(input()))

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

    from collections import Counter

    c = Counter(a)

    cnt = 0

    for i,j in list(c.items()):

        if i == 1:

            cnt += max(j-1,0)

        else:

            cnt += j%i

    print(cnt)



if __name__ == '__main__':

    main()

from collections import Counter

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

def main():
    n = int(eval(input()))
    a = list(map(int, input().split()))
    from collections import Counter

    c = Counter(a)
    cnt = 0
    for i, j in list(c.items()):
        if i == 1:
            cnt += max(j - 1, 0)
        else:
            cnt += j % i
    print(cnt)


if __name__ == "__main__":
    main()

-from collections import Counter +def main(): +    n = int(eval(input())) +    a = list(map(int, input().split())) +    from collections import Counter -n = int(eval(input())) -a = Counter(input().split()) -ans = 0 -for i, j in list(a.items()): -    i = int(i) -    if i > j: -        ans += j -    elif i < j: -        ans += j - i -print(ans) +    c = Counter(a) +    cnt = 0 +    for i, j in list(c.items()): +        if i == 1: +            cnt += max(j - 1, 0) +        else: +            cnt += j % i +    print(cnt) + + +if __name__ == "__main__": +    main()