Problem link : Interesting Sequences
Difficulty : Easy
Setter : Harshit Garg
Code :
from collections import Counter
n = int(input())
l = list(map(int,input().split()))
c = Counter(l)
f = 0
for i in c.keys():
if c[i]>=i:
f+=c[i]-i
else:
f+=c[i]
print(f)