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).
# def most_frequent(List):
#     return max(set(List), key = List.count)
#
#
# input()
# nums = [int(num) for num in input().split(" ")]
# ones = 0
# twos = 0
# threes = 0
# for i in range(len(nums)):
#     if nums[i] == 1:
#         ones += 1
#     elif nums[i] == 2:
#         twos += 1
#     else:
#         threes += 1
# if ones == twos and twos == threes:
#     print(2*ones)
# elif  most_frequent(nums) == 1 :
#     print(twos + threes)
# elif most_frequent(nums) == 2 :
#     print(ones + threes)
# else:
#     print(ones + twos)


n, arr = input(), [0, 0, 0]
for item in input().split(" "):
    if item == '1':
        arr[0] += 1
    elif item == '2':
        arr[1] += 1
    else:
        arr[2] += 1
arr.sort()
print(arr[0] + arr[1])
