n = int(eval(input()))

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



a = {}

for i in range(0, len(v), 2):

    a[v[i]] = a.get(v[i], 0) + 1



b = {}

for i in range(1, len(v), 2):

    b[v[i]] = b.get(v[i], 0) + 1



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

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



res = 0

if sorted_a[0][0] == sorted_b[0][0]:

    if sorted_a[0][1] > sorted_b[0][1]:

        sorted_b[0], sorted_b[1] = sorted_b[1], sorted_b[0]

    elif sorted_a[0][1] < sorted_b[0][1]:

        sorted_a[0], sorted_a[1] = sorted_a[1], sorted_a[0]

    else:

        if len(sorted_b) == 1:

            res += sorted_b[0][1]

        elif sorted_a[1][1] > sorted_b[1][1]:

            sorted_a[0], sorted_a[1] = sorted_a[1], sorted_a[0]

        else:

            sorted_b[0], sorted_b[1] = sorted_b[1], sorted_b[0]



res += len(v) - sorted_a[0][1] - sorted_b[0][1]



print(res)
from collections import Counter



n = int(eval(input()))

v = [int(x) for x in input().split()]



odd = sorted(list(Counter(v[0:n:2]).items()), reverse=True, key=lambda x: x[1])

even = sorted(list(Counter(v[1:n+1:2]).items()), reverse=True, key=lambda x: x[1])



if odd[0][0] != even[0][0]:

    res = n - odd[0][1] - even[0][1]

elif len(odd) == 1:

    res = odd[0][1]

else:

    if odd[0][1] == even[0][1]:

        if odd[1][1] >= even[1][1]:

            res = n - odd[1][1] - even[0][1]

        else:

            res = n - odd[0][1] - even[1][1]

    elif odd[0][1] > even[0][1]:

        res = n - odd[0][1] - even[1][1]

    else:

        res = n - odd[1][1] - even[0][1]



print(res)

n = int(eval(input()))
v = list(map(int, input().split()))
a = {}
for i in range(0, len(v), 2):
    a[v[i]] = a.get(v[i], 0) + 1
b = {}
for i in range(1, len(v), 2):
    b[v[i]] = b.get(v[i], 0) + 1
sorted_a = sorted(list(a.items()), reverse=True, key=lambda x: x[1])
sorted_b = sorted(list(b.items()), reverse=True, key=lambda x: x[1])
res = 0
if sorted_a[0][0] == sorted_b[0][0]:
    if sorted_a[0][1] > sorted_b[0][1]:
        sorted_b[0], sorted_b[1] = sorted_b[1], sorted_b[0]
    elif sorted_a[0][1] < sorted_b[0][1]:
        sorted_a[0], sorted_a[1] = sorted_a[1], sorted_a[0]
    else:
        if len(sorted_b) == 1:
            res += sorted_b[0][1]
        elif sorted_a[1][1] > sorted_b[1][1]:
            sorted_a[0], sorted_a[1] = sorted_a[1], sorted_a[0]
        else:
            sorted_b[0], sorted_b[1] = sorted_b[1], sorted_b[0]
res += len(v) - sorted_a[0][1] - sorted_b[0][1]
print(res)

from collections import Counter

n = int(eval(input()))
v = [int(x) for x in input().split()]
odd = sorted(list(Counter(v[0:n:2]).items()), reverse=True, key=lambda x: x[1])
even = sorted(list(Counter(v[1 : n + 1 : 2]).items()), reverse=True, key=lambda x: x[1])
if odd[0][0] != even[0][0]:
    res = n - odd[0][1] - even[0][1]
elif len(odd) == 1:
    res = odd[0][1]
else:
    if odd[0][1] == even[0][1]:
        if odd[1][1] >= even[1][1]:
            res = n - odd[1][1] - even[0][1]
        else:
            res = n - odd[0][1] - even[1][1]
    elif odd[0][1] > even[0][1]:
        res = n - odd[0][1] - even[1][1]
    else:
        res = n - odd[1][1] - even[0][1]
print(res)

+from collections import Counter + -v = list(map(int, input().split())) -a = {} -for i in range(0, len(v), 2): -    a[v[i]] = a.get(v[i], 0) + 1 -b = {} -for i in range(1, len(v), 2): -    b[v[i]] = b.get(v[i], 0) + 1 -sorted_a = sorted(list(a.items()), reverse=True, key=lambda x: x[1]) -sorted_b = sorted(list(b.items()), reverse=True, key=lambda x: x[1]) -res = 0 -if sorted_a[0][0] == sorted_b[0][0]: -    if sorted_a[0][1] > sorted_b[0][1]: -        sorted_b[0], sorted_b[1] = sorted_b[1], sorted_b[0] -    elif sorted_a[0][1] < sorted_b[0][1]: -        sorted_a[0], sorted_a[1] = sorted_a[1], sorted_a[0] +v = [int(x) for x in input().split()] +odd = sorted(list(Counter(v[0:n:2]).items()), reverse=True, key=lambda x: x[1]) +even = sorted(list(Counter(v[1 : n + 1 : 2]).items()), reverse=True, key=lambda x: x[1]) +if odd[0][0] != even[0][0]: +    res = n - odd[0][1] - even[0][1] +elif len(odd) == 1: +    res = odd[0][1] +else: +    if odd[0][1] == even[0][1]: +        if odd[1][1] >= even[1][1]: +            res = n - odd[1][1] - even[0][1] +        else: +            res = n - odd[0][1] - even[1][1] +    elif odd[0][1] > even[0][1]: +        res = n - odd[0][1] - even[1][1] -        if len(sorted_b) == 1: -            res += sorted_b[0][1] -        elif sorted_a[1][1] > sorted_b[1][1]: -            sorted_a[0], sorted_a[1] = sorted_a[1], sorted_a[0] -        else: -            sorted_b[0], sorted_b[1] = sorted_b[1], sorted_b[0] -res += len(v) - sorted_a[0][1] - sorted_b[0][1] +        res = n - odd[1][1] - even[0][1]