from collections import Counter





n = int(eval(input()))

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





lst_o = lst_v[::2]

lst_e = lst_v[1::2]

cnt_o = Counter(lst_o).most_common() + [(0, 0)]

cnt_e = Counter(lst_e).most_common() + [(0, 0)]





if cnt_o[0][0] == cnt_e[0][0]:

    rem_number = max(cnt_o[0][1] + cnt_e[1][1], cnt_o[1][1] + cnt_e[0][1])

else:

    rem_number = cnt_o[0][1] + cnt_e[0][1]

ans = n - rem_number





print(ans)
from collections import Counter



n = int(eval(input()))

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



ac = Counter(ls[::2]).most_common(2)

bd = Counter(ls[1::2]).most_common(2)



if ac[0][0] != bd[0][0]:

    print((n-ac[0][1]-bd[0][1]))

else:

    if len(ac) == 1 or len(bd) == 1:

        print((n//2))

    else:

        print((n-max(ac[0][1] + bd[1][1], ac[1][1] + bd[0][1])))
from collections import Counter

n = int(eval(input()))
lst_v = list(map(int, input().split()))
lst_o = lst_v[::2]
lst_e = lst_v[1::2]
cnt_o = Counter(lst_o).most_common() + [(0, 0)]
cnt_e = Counter(lst_e).most_common() + [(0, 0)]
if cnt_o[0][0] == cnt_e[0][0]:
    rem_number = max(cnt_o[0][1] + cnt_e[1][1], cnt_o[1][1] + cnt_e[0][1])
else:
    rem_number = cnt_o[0][1] + cnt_e[0][1]
ans = n - rem_number
print(ans)

from collections import Counter

n = int(eval(input()))
ls = list(map(int, input().split()))
ac = Counter(ls[::2]).most_common(2)
bd = Counter(ls[1::2]).most_common(2)
if ac[0][0] != bd[0][0]:
    print((n - ac[0][1] - bd[0][1]))
else:
    if len(ac) == 1 or len(bd) == 1:
        print((n // 2))
    else:
        print((n - max(ac[0][1] + bd[1][1], ac[1][1] + bd[0][1])))

-lst_v = list(map(int, input().split())) -lst_o = lst_v[::2] -lst_e = lst_v[1::2] -cnt_o = Counter(lst_o).most_common() + [(0, 0)] -cnt_e = Counter(lst_e).most_common() + [(0, 0)] -if cnt_o[0][0] == cnt_e[0][0]: -    rem_number = max(cnt_o[0][1] + cnt_e[1][1], cnt_o[1][1] + cnt_e[0][1]) +ls = list(map(int, input().split())) +ac = Counter(ls[::2]).most_common(2) +bd = Counter(ls[1::2]).most_common(2) +if ac[0][0] != bd[0][0]: +    print((n - ac[0][1] - bd[0][1])) -    rem_number = cnt_o[0][1] + cnt_e[0][1] -ans = n - rem_number -print(ans) +    if len(ac) == 1 or len(bd) == 1: +        print((n // 2)) +    else: +        print((n - max(ac[0][1] + bd[1][1], ac[1][1] + bd[0][1])))