from collections import Counter

n,k=list(map(int,input().split()))

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

ans=0

keys,counts=list(zip(*a.most_common()))

for num,(key,count) in enumerate(zip(keys,counts)):

    if int(num)>k-1:ans+=count

print(ans)
from collections import Counter

n,k=list(map(int,input().split()))

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

print((sum(sorted(list(a.values()),reverse=True)[k:])))
from collections import Counter

n, k = list(map(int, input().split()))
a = Counter(input().split())
ans = 0
keys, counts = list(zip(*a.most_common()))
for num, (key, count) in enumerate(zip(keys, counts)):
    if int(num) > k - 1:
        ans += count
print(ans)

from collections import Counter

n, k = list(map(int, input().split()))
a = Counter(input().split())
print((sum(sorted(list(a.values()), reverse=True)[k:])))

-ans = 0 -keys, counts = list(zip(*a.most_common())) -for num, (key, count) in enumerate(zip(keys, counts)): -    if int(num) > k - 1: -        ans += count -print(ans) +print((sum(sorted(list(a.values()), reverse=True)[k:])))