111

a=int(input())
b=list(map(int,input().split()))
b.sort()
s=0
sm=[]
h=len(b)
for i in range(h):
    for j in range(h):
        if b[i]==b[j]:
            s+=1
    sm.append(s)
    s=0
print(a-max(sm))
Angry Antelope