There is a given sequence of integers *a*<sub class="lower-index">1</sub>, *a*<sub class="lower-index">2</sub>, ..., *a*<sub class="lower-index">*n*</sub>, where every number is from 1 to 3 inclusively. You have to replace the minimum number of numbers in it so that all the numbers in the sequence are equal to each other.
The first line contains an integer *n* (1 ≤ *n* ≤ 10<sup class="upper-index">6</sup>). The second line contains a sequence of integers *a*<sub class="lower-index">1</sub>, *a*<sub class="lower-index">2</sub>, ..., *a*<sub class="lower-index">*n*</sub> (1 ≤ *a*<sub class="lower-index">*i*</sub> ≤ 3).
n=int(input())
arr=[int(x) for x in input().split()]
sum1=0
sum2=0
sum3=0
for i in arr:
    if i==1:
        sum1=sum1+1
    elif i==2:
        sum2=sum2+1 
    elif i==3:
        sum3=sum3+1
    
sum4=0
if sum1==sum2 and sum1==sum3:
    print(sum4)
else:
    if sum1>sum2 and sum1>sum3:
        sum4=sum2+sum3
        print(sum4)
    elif sum2>sum3 and sum2>sum1:
        sum4=sum1+sum3
        print(sum4)
    else:
        sum4=sum1+sum2
        print(sum4)
