n = int(eval(input()))

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



a = []

b = []



a_dic = {}

b_dic = {}



for i in range(n):

    if i % 2 == 0:

        if v[i] in list(a_dic.keys()):

            a_dic[v[i]] += 1

        else:

            a_dic[v[i]] = 1

    else:

        if v[i] in list(b_dic.keys()):

            b_dic[v[i]] += 1

        else:

            b_dic[v[i]] = 1



max_a = 0

max_b = 0



max_a_ind = 0

max_b_ind = 0

 

for i, val in list(a_dic.items()):

    if val > max_a:

        max_a = val

        max_a_ind = i



for i, val in list(b_dic.items()):

    if val > max_b:

        max_b = val

        max_b_ind = i



n_2 = int(n / 2)



ans = (n_2 - max_a) + (n_2 - max_b)



if (len(a_dic) == 1 and len(b_dic) == 1) and list(a_dic.keys()) ==  list(b_dic.keys()):

    print(n_2)



elif max_a_ind == max_b_ind:

    list_a = sorted(list(a_dic.values()), reverse=True)

    list_b = sorted(list(b_dic.values()), reverse=True)

    if list_a[0] > list_b[0]:

        ans = n_2 - list_a[0] + n_2 - list_b[1]

    elif list_a[0] < list_b[0]:

        ans = n_2 - list_a[1] + n_2 - list_b[0]

    else:

        ans = n_2 - list_a[0] + n_2 - max(list_a[1], list_b[1])

    print(ans)



else:

    print(ans)



# -*- coding: utf-8 -*-



from collections import Counter





n = int(eval(input()))

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

odd = Counter(v[0::2]).most_common(2) + [(0, 0)]

even = Counter(v[1::2]).most_common(2) + [(0, 0)]



n_half = int(n / 2)



if (len(odd) == 1 and len(even) == 1) and odd[0][0] == even[0][0]:

    ans = n_half

elif odd[0][0] == even[0][0]:

    ans = min(n_half - odd[0][1] + n_half - even[1][1],\

            n_half - odd[1][1] + n_half - even[0][1])

else:

    ans = n_half - odd[0][1] + n_half - even[0][1]



print(ans)

n = int(eval(input()))
v = list(map(int, input().split()))
a = []
b = []
a_dic = {}
b_dic = {}
for i in range(n):
    if i % 2 == 0:
        if v[i] in list(a_dic.keys()):
            a_dic[v[i]] += 1
        else:
            a_dic[v[i]] = 1
    else:
        if v[i] in list(b_dic.keys()):
            b_dic[v[i]] += 1
        else:
            b_dic[v[i]] = 1
max_a = 0
max_b = 0
max_a_ind = 0
max_b_ind = 0
for i, val in list(a_dic.items()):
    if val > max_a:
        max_a = val
        max_a_ind = i
for i, val in list(b_dic.items()):
    if val > max_b:
        max_b = val
        max_b_ind = i
n_2 = int(n / 2)
ans = (n_2 - max_a) + (n_2 - max_b)
if (len(a_dic) == 1 and len(b_dic) == 1) and list(a_dic.keys()) == list(b_dic.keys()):
    print(n_2)
elif max_a_ind == max_b_ind:
    list_a = sorted(list(a_dic.values()), reverse=True)
    list_b = sorted(list(b_dic.values()), reverse=True)
    if list_a[0] > list_b[0]:
        ans = n_2 - list_a[0] + n_2 - list_b[1]
    elif list_a[0] < list_b[0]:
        ans = n_2 - list_a[1] + n_2 - list_b[0]
    else:
        ans = n_2 - list_a[0] + n_2 - max(list_a[1], list_b[1])
    print(ans)
else:
    print(ans)

# -*- coding: utf-8 -*-
from collections import Counter

n = int(eval(input()))
v = list(map(int, input().split()))
odd = Counter(v[0::2]).most_common(2) + [(0, 0)]
even = Counter(v[1::2]).most_common(2) + [(0, 0)]
n_half = int(n / 2)
if (len(odd) == 1 and len(even) == 1) and odd[0][0] == even[0][0]:
    ans = n_half
elif odd[0][0] == even[0][0]:
    ans = min(
        n_half - odd[0][1] + n_half - even[1][1],
        n_half - odd[1][1] + n_half - even[0][1],
    )
else:
    ans = n_half - odd[0][1] + n_half - even[0][1]
print(ans)

+# -*- coding: utf-8 -*- +from collections import Counter + -a = [] -b = [] -a_dic = {} -b_dic = {} -for i in range(n): -    if i % 2 == 0: -        if v[i] in list(a_dic.keys()): -            a_dic[v[i]] += 1 -        else: -            a_dic[v[i]] = 1 -    else: -        if v[i] in list(b_dic.keys()): -            b_dic[v[i]] += 1 -        else: -            b_dic[v[i]] = 1 -max_a = 0 -max_b = 0 -max_a_ind = 0 -max_b_ind = 0 -for i, val in list(a_dic.items()): -    if val > max_a: -        max_a = val -        max_a_ind = i -for i, val in list(b_dic.items()): -    if val > max_b: -        max_b = val -        max_b_ind = i -n_2 = int(n / 2) -ans = (n_2 - max_a) + (n_2 - max_b) -if (len(a_dic) == 1 and len(b_dic) == 1) and list(a_dic.keys()) == list(b_dic.keys()): -    print(n_2) -elif max_a_ind == max_b_ind: -    list_a = sorted(list(a_dic.values()), reverse=True) -    list_b = sorted(list(b_dic.values()), reverse=True) -    if list_a[0] > list_b[0]: -        ans = n_2 - list_a[0] + n_2 - list_b[1] -    elif list_a[0] < list_b[0]: -        ans = n_2 - list_a[1] + n_2 - list_b[0] -    else: -        ans = n_2 - list_a[0] + n_2 - max(list_a[1], list_b[1]) -    print(ans) +odd = Counter(v[0::2]).most_common(2) + [(0, 0)] +even = Counter(v[1::2]).most_common(2) + [(0, 0)] +n_half = int(n / 2) +if (len(odd) == 1 and len(even) == 1) and odd[0][0] == even[0][0]: +    ans = n_half +elif odd[0][0] == even[0][0]: +    ans = min( +        n_half - odd[0][1] + n_half - even[1][1], +        n_half - odd[1][1] + n_half - even[0][1], +    ) -    print(ans) +    ans = n_half - odd[0][1] + n_half - even[0][1] +print(ans)