from collections import Counter



n = int(eval(input()))

A = [int(i) for i in input().split()]

A0 = []

A1 = []

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

    A0.append(A[i])

    A1.append(A[i + 1])

    

C0 = Counter(A0).most_common()

C1 = Counter(A1).most_common()



if C0[0][0] != C1[0][0]:

    ans = n - C0[0][1] - C1[0][1]

else:

    if len(C0) == 1 and len(C1) == 1:

        ans = n // 2

    elif len(C0) != 1 and len(C1) != 1:

        ans = min(n - C0[0][1] - C1[1][1], n - C0[1][1] - C1[0][1])

    elif len(C0) != 1 and len(C1) == 1:

        ans = n // 2 - C0[0][1]

    else:

        ans = n // 2 - C1[0][1]

        

print(ans)
from collections import Counter



n = int(eval(input()))

A = [int(i) for i in input().split()]

S = Counter(A[0::2]).most_common()

T = Counter(A[1::2]).most_common()



if S[0][0] != T[0][0]:

    ans = n - S[0][1] - T[0][1]

elif S[0][0] == T[0][0]:

    if len(S) == 1 and len(T) > 1:

        ans = n // 2 - T[0][1]

    elif len(S) > 1 and len(T) == 1:

        ans = n // 2 - S[0][1]

    elif len(S) > 1 and len(T) > 1:

        ans = min(n - S[0][1] - T[1][1], n - S[1][1] - T[0][1])

    else:

        ans = n // 2

        

print(ans)
from collections import Counter

n = int(eval(input()))
A = [int(i) for i in input().split()]
A0 = []
A1 = []
for i in range(0, n, 2):
    A0.append(A[i])
    A1.append(A[i + 1])
C0 = Counter(A0).most_common()
C1 = Counter(A1).most_common()
if C0[0][0] != C1[0][0]:
    ans = n - C0[0][1] - C1[0][1]
else:
    if len(C0) == 1 and len(C1) == 1:
        ans = n // 2
    elif len(C0) != 1 and len(C1) != 1:
        ans = min(n - C0[0][1] - C1[1][1], n - C0[1][1] - C1[0][1])
    elif len(C0) != 1 and len(C1) == 1:
        ans = n // 2 - C0[0][1]
    else:
        ans = n // 2 - C1[0][1]
print(ans)

from collections import Counter

n = int(eval(input()))
A = [int(i) for i in input().split()]
S = Counter(A[0::2]).most_common()
T = Counter(A[1::2]).most_common()
if S[0][0] != T[0][0]:
    ans = n - S[0][1] - T[0][1]
elif S[0][0] == T[0][0]:
    if len(S) == 1 and len(T) > 1:
        ans = n // 2 - T[0][1]
    elif len(S) > 1 and len(T) == 1:
        ans = n // 2 - S[0][1]
    elif len(S) > 1 and len(T) > 1:
        ans = min(n - S[0][1] - T[1][1], n - S[1][1] - T[0][1])
    else:
        ans = n // 2
print(ans)

-A0 = [] -A1 = [] -for i in range(0, n, 2): -    A0.append(A[i]) -    A1.append(A[i + 1]) -C0 = Counter(A0).most_common() -C1 = Counter(A1).most_common() -if C0[0][0] != C1[0][0]: -    ans = n - C0[0][1] - C1[0][1] -else: -    if len(C0) == 1 and len(C1) == 1: +S = Counter(A[0::2]).most_common() +T = Counter(A[1::2]).most_common() +if S[0][0] != T[0][0]: +    ans = n - S[0][1] - T[0][1] +elif S[0][0] == T[0][0]: +    if len(S) == 1 and len(T) > 1: +        ans = n // 2 - T[0][1] +    elif len(S) > 1 and len(T) == 1: +        ans = n // 2 - S[0][1] +    elif len(S) > 1 and len(T) > 1: +        ans = min(n - S[0][1] - T[1][1], n - S[1][1] - T[0][1]) +    else: -    elif len(C0) != 1 and len(C1) != 1: -        ans = min(n - C0[0][1] - C1[1][1], n - C0[1][1] - C1[0][1]) -    elif len(C0) != 1 and len(C1) == 1: -        ans = n // 2 - C0[0][1] -    else: -        ans = n // 2 - C1[0][1]