n = int(eval(input()))

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



a, b = dict(), dict()

for i in range(n):

    if i%2 == 0:

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

    else:

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

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

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



if alst[0][0] != blst[0][0]:

    print((n-alst[0][1]-blst[0][1]))

elif len(alst) == 1 and len(blst) == 1:

    print((blst[0][1]))    

elif len(alst) == 1:

    print((n-alst[0][1]-blst[1][1]))

elif len(blst) == 1:

    print((n-alst[1][1]-blst[0][1]))

elif blst[0][1]+alst[1][1] > alst[0][1]+blst[1][1]:

    print((n-alst[1][1]-blst[0][1]))

else:

    print((n-alst[0][1]-blst[1][1]))
import collections

n = int(eval(input()))

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



dummy = [(-1, 0)]

(av1, ak1), (av2, ak2) = (collections.Counter(v[::2]).most_common(2) + dummy)[:2]

(bv1, bk1), (bv2, bk2) = (collections.Counter(v[1::2]).most_common(2) + dummy)[:2]



if av1 != bv1:

    print((n-ak1-bk1))

elif ak1 < bk1:

    print((n-ak2-bk1))

elif ak1 > bk1:

    print((n-ak1-bk2))

elif ak1+bk2 > bk1+ak2:

    print((n-ak1-bk2))

else:

    print((n-ak2-bk1))
n = int(eval(input()))
v = [int(i) for i in input().split()]
a, b = dict(), dict()
for i in range(n):
    if i % 2 == 0:
        a[v[i]] = a.get(v[i], 0) + 1
    else:
        b[v[i]] = b.get(v[i], 0) + 1
alst = sorted(list(a.items()), key=lambda x: x[1], reverse=True)
blst = sorted(list(b.items()), key=lambda x: x[1], reverse=True)
if alst[0][0] != blst[0][0]:
    print((n - alst[0][1] - blst[0][1]))
elif len(alst) == 1 and len(blst) == 1:
    print((blst[0][1]))
elif len(alst) == 1:
    print((n - alst[0][1] - blst[1][1]))
elif len(blst) == 1:
    print((n - alst[1][1] - blst[0][1]))
elif blst[0][1] + alst[1][1] > alst[0][1] + blst[1][1]:
    print((n - alst[1][1] - blst[0][1]))
else:
    print((n - alst[0][1] - blst[1][1]))

import collections

n = int(eval(input()))
v = [int(i) for i in input().split()]
dummy = [(-1, 0)]
(av1, ak1), (av2, ak2) = (collections.Counter(v[::2]).most_common(2) + dummy)[:2]
(bv1, bk1), (bv2, bk2) = (collections.Counter(v[1::2]).most_common(2) + dummy)[:2]
if av1 != bv1:
    print((n - ak1 - bk1))
elif ak1 < bk1:
    print((n - ak2 - bk1))
elif ak1 > bk1:
    print((n - ak1 - bk2))
elif ak1 + bk2 > bk1 + ak2:
    print((n - ak1 - bk2))
else:
    print((n - ak2 - bk1))

+import collections + -a, b = dict(), dict() -for i in range(n): -    if i % 2 == 0: -        a[v[i]] = a.get(v[i], 0) + 1 -    else: -        b[v[i]] = b.get(v[i], 0) + 1 -alst = sorted(list(a.items()), key=lambda x: x[1], reverse=True) -blst = sorted(list(b.items()), key=lambda x: x[1], reverse=True) -if alst[0][0] != blst[0][0]: -    print((n - alst[0][1] - blst[0][1])) -elif len(alst) == 1 and len(blst) == 1: -    print((blst[0][1])) -elif len(alst) == 1: -    print((n - alst[0][1] - blst[1][1])) -elif len(blst) == 1: -    print((n - alst[1][1] - blst[0][1])) -elif blst[0][1] + alst[1][1] > alst[0][1] + blst[1][1]: -    print((n - alst[1][1] - blst[0][1])) +dummy = [(-1, 0)] +(av1, ak1), (av2, ak2) = (collections.Counter(v[::2]).most_common(2) + dummy)[:2] +(bv1, bk1), (bv2, bk2) = (collections.Counter(v[1::2]).most_common(2) + dummy)[:2] +if av1 != bv1: +    print((n - ak1 - bk1)) +elif ak1 < bk1: +    print((n - ak2 - bk1)) +elif ak1 > bk1: +    print((n - ak1 - bk2)) +elif ak1 + bk2 > bk1 + ak2: +    print((n - ak1 - bk2)) -    print((n - alst[0][1] - blst[1][1])) +    print((n - ak2 - bk1))