n = int(eval(input()))

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



list_Vx = []

list_Vy = []



for i, s in enumerate(list_V):

    if i % 2 == 0:

        list_Vx.append(s)

    else:

        list_Vy.append(s)



list_Vx_Count = [0 for _ in range(pow(10, 5))]

list_Vy_Count = [0 for _ in range(pow(10, 5))]



for i in list_Vx:

    list_Vx_Count[i-1] += 1

for i in list_Vy:

    list_Vy_Count[i-1] += 1



ans = n - max(list_Vx_Count) - max(list_Vy_Count)



if list_Vx_Count.count(max(list_Vx_Count)) == 1 and list_Vy_Count.count(max(list_Vy_Count)):

    if list_Vx_Count.index(max(list_Vx_Count)) == list_Vy_Count.index(max(list_Vy_Count)):

        ans = n - max(max(list_Vx_Count)+sorted(list_Vx_Count)[-2], max(list_Vy_Count)+sorted(list_Vy_Count)[-2])



print(ans)
from collections import Counter



n = int(eval(input()))

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

L, R = [], []



for i in range(n):

    if i % 2 == 0:

        L.append(list_A[i])

    else:

        R.append(list_A[i])



A = Counter(L)

A = sorted(list(A.items()), key=lambda x:x[1], reverse=True)

A.append((-1, 0))



B = Counter(R)

B = sorted(list(B.items()), key=lambda x:x[1], reverse=True)

B.append((-1, 0))



if A[0][0] != B[0][0]:

    print((n - A[0][1] - B[0][1]))

else:

    print((min(n - A[1][1] - B[0][1], n - A[0][1] - B[1][1])))

n = int(eval(input()))
list_V = list(map(int, input().split()))
list_Vx = []
list_Vy = []
for i, s in enumerate(list_V):
    if i % 2 == 0:
        list_Vx.append(s)
    else:
        list_Vy.append(s)
list_Vx_Count = [0 for _ in range(pow(10, 5))]
list_Vy_Count = [0 for _ in range(pow(10, 5))]
for i in list_Vx:
    list_Vx_Count[i - 1] += 1
for i in list_Vy:
    list_Vy_Count[i - 1] += 1
ans = n - max(list_Vx_Count) - max(list_Vy_Count)
if list_Vx_Count.count(max(list_Vx_Count)) == 1 and list_Vy_Count.count(
    max(list_Vy_Count)
):
    if list_Vx_Count.index(max(list_Vx_Count)) == list_Vy_Count.index(
        max(list_Vy_Count)
    ):
        ans = n - max(
            max(list_Vx_Count) + sorted(list_Vx_Count)[-2],
            max(list_Vy_Count) + sorted(list_Vy_Count)[-2],
        )
print(ans)

from collections import Counter

n = int(eval(input()))
list_A = list(map(int, input().split()))
L, R = [], []
for i in range(n):
    if i % 2 == 0:
        L.append(list_A[i])
    else:
        R.append(list_A[i])
A = Counter(L)
A = sorted(list(A.items()), key=lambda x: x[1], reverse=True)
A.append((-1, 0))
B = Counter(R)
B = sorted(list(B.items()), key=lambda x: x[1], reverse=True)
B.append((-1, 0))
if A[0][0] != B[0][0]:
    print((n - A[0][1] - B[0][1]))
else:
    print((min(n - A[1][1] - B[0][1], n - A[0][1] - B[1][1])))

+from collections import Counter + -list_V = list(map(int, input().split())) -list_Vx = [] -list_Vy = [] -for i, s in enumerate(list_V): +list_A = list(map(int, input().split())) +L, R = [], [] +for i in range(n): -        list_Vx.append(s) +        L.append(list_A[i]) -        list_Vy.append(s) -list_Vx_Count = [0 for _ in range(pow(10, 5))] -list_Vy_Count = [0 for _ in range(pow(10, 5))] -for i in list_Vx: -    list_Vx_Count[i - 1] += 1 -for i in list_Vy: -    list_Vy_Count[i - 1] += 1 -ans = n - max(list_Vx_Count) - max(list_Vy_Count) -if list_Vx_Count.count(max(list_Vx_Count)) == 1 and list_Vy_Count.count( -    max(list_Vy_Count) -): -    if list_Vx_Count.index(max(list_Vx_Count)) == list_Vy_Count.index( -        max(list_Vy_Count) -    ): -        ans = n - max( -            max(list_Vx_Count) + sorted(list_Vx_Count)[-2], -            max(list_Vy_Count) + sorted(list_Vy_Count)[-2], -        ) -print(ans) +        R.append(list_A[i]) +A = Counter(L) +A = sorted(list(A.items()), key=lambda x: x[1], reverse=True) +A.append((-1, 0)) +B = Counter(R) +B = sorted(list(B.items()), key=lambda x: x[1], reverse=True) +B.append((-1, 0)) +if A[0][0] != B[0][0]: +    print((n - A[0][1] - B[0][1])) +else: +    print((min(n - A[1][1] - B[0][1], n - A[0][1] - B[1][1])))