N,K = list(map(int,input().split()))

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

D = {}

for i in A :

    if i in D :

        D[i] += 1

    else :

        D[i] = 1

D = sorted(list(D.items()),key=lambda x:x[1])

counter = 0

answer = 0

for j in range(len(D)) :

    if len(D) - counter > K :

        counter += 1

        answer += D[j][1]

    else :

        print(answer)

        break

N,K = list(map(int,input().split()))

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

D = {}

for i in A :

    if i in D :

        D[i] += 1

    else :

        D[i] = 1

L = list(D.values())

L = sorted(L)

ans = 0

counter = 0

for i in range(len(L)) :

    if len(L) - counter > K :

        ans += L[i]

        counter += 1

    else :

        print(ans)

        break

N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
D = {}
for i in A:
    if i in D:
        D[i] += 1
    else:
        D[i] = 1
D = sorted(list(D.items()), key=lambda x: x[1])
counter = 0
answer = 0
for j in range(len(D)):
    if len(D) - counter > K:
        counter += 1
        answer += D[j][1]
    else:
        print(answer)
        break

N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
D = {}
for i in A:
    if i in D:
        D[i] += 1
    else:
        D[i] = 1
L = list(D.values())
L = sorted(L)
ans = 0
counter = 0
for i in range(len(L)):
    if len(L) - counter > K:
        ans += L[i]
        counter += 1
    else:
        print(ans)
        break

-D = sorted(list(D.items()), key=lambda x: x[1]) +L = list(D.values()) +L = sorted(L) +ans = 0 -answer = 0 -for j in range(len(D)): -    if len(D) - counter > K: +for i in range(len(L)): +    if len(L) - counter > K: +        ans += L[i] -        answer += D[j][1] -        print(answer) +        print(ans)