from collections import Counter

from itertools import takewhile



n = int(eval(input()))

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

cnt1 = Counter(vvv[0::2])

cnt2 = Counter(vvv[1::2])

mc1 = cnt1.most_common()

mc2 = cnt2.most_common()

mcs1 = list(takewhile(lambda x: x[1] == mc1[0][1], mc1))

mcs2 = list(takewhile(lambda x: x[1] == mc2[0][1], mc2))

if len(mcs1) == len(mcs2) and mcs1[0][0] == mcs2[0][0]:

    if len(mc1) > 1:

        if len(mc2) > 1:

            print((min(n - mc1[0][1] - mc2[1][1], n - mc1[1][1] - mc2[0][1])))

        else:

            print((min(n - mc1[0][1], n - mc1[1][1] - mc2[0][1])))

    else:

        if len(mc2) > 1:

            print((min(n - mc1[0][1] - mc2[1][1], n - mc2[0][1])))

        else:

            print((min(n - mc1[0][1], n - mc2[0][1])))

else:

    print((n - mc1[0][1] - mc2[0][1]))

from collections import Counter



n = int(eval(input()))

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

cnt1 = Counter(vvv[0::2])

cnt2 = Counter(vvv[1::2])

mc1 = cnt1.most_common(2)

mc2 = cnt2.most_common(2)

if mc1[0][0] == mc2[0][0]:

    sc1 = mc1[1][1] if len(mc1) > 1 else 0

    sc2 = mc2[1][1] if len(mc2) > 1 else 0

    print((min(n - mc1[0][1] - sc2, n - sc1 - mc2[0][1])))

else:

    print((n - mc1[0][1] - mc2[0][1]))

from collections import Counter
from itertools import takewhile

n = int(eval(input()))
vvv = list(map(int, input().split()))
cnt1 = Counter(vvv[0::2])
cnt2 = Counter(vvv[1::2])
mc1 = cnt1.most_common()
mc2 = cnt2.most_common()
mcs1 = list(takewhile(lambda x: x[1] == mc1[0][1], mc1))
mcs2 = list(takewhile(lambda x: x[1] == mc2[0][1], mc2))
if len(mcs1) == len(mcs2) and mcs1[0][0] == mcs2[0][0]:
    if len(mc1) > 1:
        if len(mc2) > 1:
            print((min(n - mc1[0][1] - mc2[1][1], n - mc1[1][1] - mc2[0][1])))
        else:
            print((min(n - mc1[0][1], n - mc1[1][1] - mc2[0][1])))
    else:
        if len(mc2) > 1:
            print((min(n - mc1[0][1] - mc2[1][1], n - mc2[0][1])))
        else:
            print((min(n - mc1[0][1], n - mc2[0][1])))
else:
    print((n - mc1[0][1] - mc2[0][1]))

from collections import Counter

n = int(eval(input()))
vvv = list(map(int, input().split()))
cnt1 = Counter(vvv[0::2])
cnt2 = Counter(vvv[1::2])
mc1 = cnt1.most_common(2)
mc2 = cnt2.most_common(2)
if mc1[0][0] == mc2[0][0]:
    sc1 = mc1[1][1] if len(mc1) > 1 else 0
    sc2 = mc2[1][1] if len(mc2) > 1 else 0
    print((min(n - mc1[0][1] - sc2, n - sc1 - mc2[0][1])))
else:
    print((n - mc1[0][1] - mc2[0][1]))

-from itertools import takewhile -mc1 = cnt1.most_common() -mc2 = cnt2.most_common() -mcs1 = list(takewhile(lambda x: x[1] == mc1[0][1], mc1)) -mcs2 = list(takewhile(lambda x: x[1] == mc2[0][1], mc2)) -if len(mcs1) == len(mcs2) and mcs1[0][0] == mcs2[0][0]: -    if len(mc1) > 1: -        if len(mc2) > 1: -            print((min(n - mc1[0][1] - mc2[1][1], n - mc1[1][1] - mc2[0][1]))) -        else: -            print((min(n - mc1[0][1], n - mc1[1][1] - mc2[0][1]))) -    else: -        if len(mc2) > 1: -            print((min(n - mc1[0][1] - mc2[1][1], n - mc2[0][1]))) -        else: -            print((min(n - mc1[0][1], n - mc2[0][1]))) +mc1 = cnt1.most_common(2) +mc2 = cnt2.most_common(2) +if mc1[0][0] == mc2[0][0]: +    sc1 = mc1[1][1] if len(mc1) > 1 else 0 +    sc2 = mc2[1][1] if len(mc2) > 1 else 0 +    print((min(n - mc1[0][1] - sc2, n - sc1 - mc2[0][1])))