from collections import Counter





n = int(eval(input()))

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





if len(set(lst_v)) == 1:

    ans = n // 2

else:

    lst_odd = lst_v[::2]

    lst_even = lst_v[1::2]

    cnt_odd = sorted(list(Counter(lst_odd).items()), key=lambda x: -x[1])

    cnt_even = sorted(list(Counter(lst_even).items()), key=lambda x :-x[1])



    if cnt_odd[0][0] == cnt_even[0][0]:

        rem_number = max(cnt_odd[0][1] + cnt_even[1][1], cnt_odd[1][1] + cnt_even[0][1])

    else:

        rem_number = cnt_odd[0][1] + cnt_even[0][1]

    sum_odd = sum(t[1] for t in cnt_odd)

    sum_even = sum(t[1] for t in cnt_even)

    ans = sum_odd + sum_even - rem_number





print(ans)

# C

import collections

n = int(eval(input()))

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

lst1 = lst[::2]

lst2 = lst[1::2]

dct1 = sorted(list(dict(collections.Counter(lst1)).items()), key=lambda x:-x[1])

dct2 = sorted(list(dict(collections.Counter(lst2)).items()), key=lambda x:-x[1])





ans = 0

if (len(dct1) == 1 and len(dct2) == 1):

	if (dct1[0][0] == dct2[0][0]):

		ans = dct1[0][1]

	else:

		ans = 0

elif (len(dct1) == 1 and len(dct2) > 1):

	if (dct1[0][0] == dct2[0][0]):

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

	else:

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

elif (len(dct2) == 1 and len(dct1) > 1):

	if (dct1[0][0] == dct2[0][0]):

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

	else:

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

elif (len(dct1) > 1 and len(dct2) > 1):

	if (dct1[0][0] == dct2[0][0]):

		ans = n - max(dct1[0][1] + dct2[1][1], dct1[1][1] + dct2[0][1])

	else:

		ans = n - dct1[0][1] - dct2[0][1]

print(ans)
from collections import Counter

n = int(eval(input()))
lst_v = list(map(int, input().split()))
if len(set(lst_v)) == 1:
    ans = n // 2
else:
    lst_odd = lst_v[::2]
    lst_even = lst_v[1::2]
    cnt_odd = sorted(list(Counter(lst_odd).items()), key=lambda x: -x[1])
    cnt_even = sorted(list(Counter(lst_even).items()), key=lambda x: -x[1])
    if cnt_odd[0][0] == cnt_even[0][0]:
        rem_number = max(cnt_odd[0][1] + cnt_even[1][1], cnt_odd[1][1] + cnt_even[0][1])
    else:
        rem_number = cnt_odd[0][1] + cnt_even[0][1]
    sum_odd = sum(t[1] for t in cnt_odd)
    sum_even = sum(t[1] for t in cnt_even)
    ans = sum_odd + sum_even - rem_number
print(ans)

# C
import collections

n = int(eval(input()))
lst = list(map(int, input().split()))
lst1 = lst[::2]
lst2 = lst[1::2]
dct1 = sorted(list(dict(collections.Counter(lst1)).items()), key=lambda x: -x[1])
dct2 = sorted(list(dict(collections.Counter(lst2)).items()), key=lambda x: -x[1])
ans = 0
if len(dct1) == 1 and len(dct2) == 1:
    if dct1[0][0] == dct2[0][0]:
        ans = dct1[0][1]
    else:
        ans = 0
elif len(dct1) == 1 and len(dct2) > 1:
    if dct1[0][0] == dct2[0][0]:
        ans = n // 2 - dct2[1][1]
    else:
        ans = n // 2 - dct2[0][1]
elif len(dct2) == 1 and len(dct1) > 1:
    if dct1[0][0] == dct2[0][0]:
        ans = n // 2 - dct1[1][1]
    else:
        ans = n // 2 - dct1[0][1]
elif len(dct1) > 1 and len(dct2) > 1:
    if dct1[0][0] == dct2[0][0]:
        ans = n - max(dct1[0][1] + dct2[1][1], dct1[1][1] + dct2[0][1])
    else:
        ans = n - dct1[0][1] - dct2[0][1]
print(ans)

-from collections import Counter +# C +import collections -lst_v = list(map(int, input().split())) -if len(set(lst_v)) == 1: -    ans = n // 2 -else: -    lst_odd = lst_v[::2] -    lst_even = lst_v[1::2] -    cnt_odd = sorted(list(Counter(lst_odd).items()), key=lambda x: -x[1]) -    cnt_even = sorted(list(Counter(lst_even).items()), key=lambda x: -x[1]) -    if cnt_odd[0][0] == cnt_even[0][0]: -        rem_number = max(cnt_odd[0][1] + cnt_even[1][1], cnt_odd[1][1] + cnt_even[0][1]) +lst = list(map(int, input().split())) +lst1 = lst[::2] +lst2 = lst[1::2] +dct1 = sorted(list(dict(collections.Counter(lst1)).items()), key=lambda x: -x[1]) +dct2 = sorted(list(dict(collections.Counter(lst2)).items()), key=lambda x: -x[1]) +ans = 0 +if len(dct1) == 1 and len(dct2) == 1: +    if dct1[0][0] == dct2[0][0]: +        ans = dct1[0][1] -        rem_number = cnt_odd[0][1] + cnt_even[0][1] -    sum_odd = sum(t[1] for t in cnt_odd) -    sum_even = sum(t[1] for t in cnt_even) -    ans = sum_odd + sum_even - rem_number +        ans = 0 +elif len(dct1) == 1 and len(dct2) > 1: +    if dct1[0][0] == dct2[0][0]: +        ans = n // 2 - dct2[1][1] +    else: +        ans = n // 2 - dct2[0][1] +elif len(dct2) == 1 and len(dct1) > 1: +    if dct1[0][0] == dct2[0][0]: +        ans = n // 2 - dct1[1][1] +    else: +        ans = n // 2 - dct1[0][1] +elif len(dct1) > 1 and len(dct2) > 1: +    if dct1[0][0] == dct2[0][0]: +        ans = n - max(dct1[0][1] + dct2[1][1], dct1[1][1] + dct2[0][1]) +    else: +        ans = n - dct1[0][1] - dct2[0][1]