52_A. 123-sequence
There is a given sequence of integers a1, a2, ..., an, 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.

Input

The first line contains an integer n (1 ≤ n ≤ 106). The second line contains a sequence of integers a1, a2, ..., an (1 ≤ ai ≤ 3).

Output

Print the minimum number of replacements needed to be performed to make all the numbers in the sequence equal.

Examples

Input

9
1 3 2 2 2 1 1 2 3


Output

5

Note

In the example all the numbers equal to 1 and 3 should be replaced by 2.
```python
from collections import deque
from math import ceil,floor,sqrt,gcd
def ii(): return int(input())
def mi(): return map(int,input().split())
def li(): return list(mi())
def si():return input()
n=ii()
a=li()
m={}
for i in a:
    if i not in m:
        m[i]=1
    else:
        m[i]+=1
b=[]
for i in m.keys():
    b.append(m[i])
b.sort()
if(len(b)==3):
    print(b[0]+b[1])
elif(len(b)==2):
    print(b[0])
else:
    print('0')
```