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 = int(input())
# counterOfOne = 0
# counterOfTwo = 0
# counterOfThree = 0
#
# arr = [int(item) for item in input().split(' ')]
#
# for i in range(len(arr)):
#     if arr[i] == 1:
#         counterOfOne += 1
#     elif arr[i] == 2:
#         counterOfTwo += 1
#     elif arr[i] == 3:
#         counterOfThree += 1
#
# if counterOfOne == 0:
#     print(counterOfTwo if counterOfTwo < counterOfThree else counterOfThree)
# elif counterOfTwo == 0:
#     print(counterOfOne if counterOfOne < counterOfThree else counterOfThree)
# elif counterOfThree == 0:
#     print(counterOfTwo if counterOfTwo < counterOfOne else counterOfOne)
#
# elif counterOfOne + counterOfTwo < counterOfOne + counterOfThree and \
#         counterOfOne + counterOfTwo < counterOfThree + counterOfTwo:
#     print(counterOfOne + counterOfTwo)
# elif counterOfOne + counterOfThree < counterOfOne + counterOfTwo \
#         and counterOfOne + counterOfThree < counterOfTwo + counterOfTwo:
#     print(counterOfOne + counterOfThree)
# elif counterOfTwo + counterOfThree < counterOfTwo + counterOfOne \
#         and counterOfTwo + counterOfThree < counterOfThree + counterOfTwo:
#     print(counterOfTwo + counterOfThree)

input()

arr = [0, 0, 0]

for item in input().split(' '):
    arr[int(item) - 1] += 1

arr.sort()
print(arr[0] + arr[1])

