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).
'''
╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬
╬╬        ▓▓     ▓▓      ╬╬
╬╬        ▓▓     ▓▓      ╬╬
╬╬        ▓▓█████▓▓      ╬╬
╬╬        ▓▓     ▓▓      ╬╬
╬╬        ▓▓     ▓▓      ╬╬
╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬

###########################

// •︿• \\
/\\    //\
 /\\  //\
  /\\//\

###########################
'''
import sys
input = lambda : sys.stdin.readline().strip()
import math as mth
from math import ceil as cl
from math import log2 as l2
from math import factorial as fct
from collections import Counter as CNT
mod = 10**9 + 7
def ii():
    return int(input())
def fi():
    return float(input())
def lii():
    return list(map(int, input().split()))
def ss():
    return input()
def lss():
    return input().split()
def yes():
    print("YES")
def no():
    print("NO")
'''
╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬
'''

n = ii()
lis= lii()
str1 = str(lis)
a = str1.count("1")
b = str1.count("2")
c = str1.count("3")
maximum = max(a,b,c)
print(len(lis)-maximum)




    
                
                
