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=input("enter no of digits")
list=[]
counter1=0
counter2=0
counter3=0
numberchanged=0
numbers=input("enter the series as "+ str(N)+" digit number")
for number in numbers:
    list.append(int(number))
for number in list:
    if number==1:
        counter1+=1
    if number == 2:
        counter2 += 1
    if number == 3:
        counter3 += 1
if counter1>counter2 and counter1>counter3:
    numberchanged=counter2+counter3
    for i  in range(len(list)):
        list[i]=1


if counter2>counter1 and counter2>counter3:
    numberchanged=counter1+counter3
    for i  in range(len(list)):
        list[i]=2
if counter3>counter1 and counter3>counter2:
    numberchanged=counter1+counter2
    for i  in range(len(list)):
        list[i]=3


print(numberchanged)
	    				 	   		 	 		  	 	   		