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).
from sys import stdin

def read_lines(sep=' ', input_type=None):
    #list of rows
    _lines = stdin.readlines()
    cast = input_type is not None
    lines = []
    for line in _lines:
        line = line[:-1].split(sep)
        if cast:
            line = [input_type(x) for x in line]
        lines.append(line)
    return lines


import collections
if __name__ == '__main__':

    lines = read_lines(input_type=int)
    
    line = lines[1:][0]
    
    counter=[0]*4
    for x in line:
        counter[x]+=1
        
    a,b,c = counter[1:]
    
    print(min(a+b,b+c,a+c))