from collections import Counter

n = int(eval(input()))

num = list(map(int, input().split()))

num1 = []

num2 = []

ans = 0



for i in range(0, n, 2):

    num1.append(num[i])

    

for i in range(1, n, 2):

    num2.append(num[i])



num1 = Counter(num1).most_common()

num2 = Counter(num2).most_common()    



if num1[0][0] != num2[0][0]:

    ans = n - num1[0][1] - num2[0][1]

else:

    if n - num1[0][1] - num2[0][1] == 0:

        ans = n // 2

    else:

        if n // 2 - num1[0][1] == 0:

            ans = n // 2 - num2[1][1]

        elif n // 2 - num2[0][1] == 0:

            ans = n // 2 - num1[1][1]

        else:

            a = n - num1[0][1] - num2[1][1]

            b = n - num1[1][1] - num2[0][1]

            ans = min(a, b)



print(ans)
from collections import Counter



n = int(eval(input()))

V = list(map(int, input().split()))

X = Counter([V[i] for i in range(0, n, 2)]).most_common()

Y = Counter([V[i] for i in range(1, n, 2)]).most_common()



ans = 0



if X[0][0] != Y[0][0]:

    ans = n - X[0][1] - Y[0][1]

else:

    if len(X) == 1 and len(Y) == 1:

        ans = n // 2

    elif len(X) == 1 and len(Y) != 1:

        ans = n // 2 - Y[1][1]

    elif len(X) != 1 and len(Y) == 1:

        ans = n // 2 - X[1][1]

    else:

        a = n - X[0][1] - Y[1][1]

        b = n - X[1][1] - Y[0][1]

        ans = min(a, b)

        

print(ans)
from collections import Counter

n = int(eval(input()))
num = list(map(int, input().split()))
num1 = []
num2 = []
ans = 0
for i in range(0, n, 2):
    num1.append(num[i])
for i in range(1, n, 2):
    num2.append(num[i])
num1 = Counter(num1).most_common()
num2 = Counter(num2).most_common()
if num1[0][0] != num2[0][0]:
    ans = n - num1[0][1] - num2[0][1]
else:
    if n - num1[0][1] - num2[0][1] == 0:
        ans = n // 2
    else:
        if n // 2 - num1[0][1] == 0:
            ans = n // 2 - num2[1][1]
        elif n // 2 - num2[0][1] == 0:
            ans = n // 2 - num1[1][1]
        else:
            a = n - num1[0][1] - num2[1][1]
            b = n - num1[1][1] - num2[0][1]
            ans = min(a, b)
print(ans)

from collections import Counter

n = int(eval(input()))
V = list(map(int, input().split()))
X = Counter([V[i] for i in range(0, n, 2)]).most_common()
Y = Counter([V[i] for i in range(1, n, 2)]).most_common()
ans = 0
if X[0][0] != Y[0][0]:
    ans = n - X[0][1] - Y[0][1]
else:
    if len(X) == 1 and len(Y) == 1:
        ans = n // 2
    elif len(X) == 1 and len(Y) != 1:
        ans = n // 2 - Y[1][1]
    elif len(X) != 1 and len(Y) == 1:
        ans = n // 2 - X[1][1]
    else:
        a = n - X[0][1] - Y[1][1]
        b = n - X[1][1] - Y[0][1]
        ans = min(a, b)
print(ans)

-num = list(map(int, input().split())) -num1 = [] -num2 = [] +V = list(map(int, input().split())) +X = Counter([V[i] for i in range(0, n, 2)]).most_common() +Y = Counter([V[i] for i in range(1, n, 2)]).most_common() -for i in range(0, n, 2): -    num1.append(num[i]) -for i in range(1, n, 2): -    num2.append(num[i]) -num1 = Counter(num1).most_common() -num2 = Counter(num2).most_common() -if num1[0][0] != num2[0][0]: -    ans = n - num1[0][1] - num2[0][1] +if X[0][0] != Y[0][0]: +    ans = n - X[0][1] - Y[0][1] -    if n - num1[0][1] - num2[0][1] == 0: +    if len(X) == 1 and len(Y) == 1: +    elif len(X) == 1 and len(Y) != 1: +        ans = n // 2 - Y[1][1] +    elif len(X) != 1 and len(Y) == 1: +        ans = n // 2 - X[1][1] -        if n // 2 - num1[0][1] == 0: -            ans = n // 2 - num2[1][1] -        elif n // 2 - num2[0][1] == 0: -            ans = n // 2 - num1[1][1] -        else: -            a = n - num1[0][1] - num2[1][1] -            b = n - num1[1][1] - num2[0][1] -            ans = min(a, b) +        a = n - X[0][1] - Y[1][1] +        b = n - X[1][1] - Y[0][1] +        ans = min(a, b)