import collections



N = int(eval(input()))

V = [int(x) for x in input().split()]



Va, Vb = [], []

for i in range(N):

    if i % 2 == 0:

        Va.append(V[i])

    else:

        Vb.append(V[i])



Va_most = collections.Counter(Va).most_common()

Vb_most = collections.Counter(Vb).most_common()



if N == collections.Counter(V).most_common()[0][1]:

    print((N//2))

    exit()



if Va_most[0][0] == Vb_most[0][0]:

    typea = 10 ** 10

    if len(Vb_most) >= 2:

        typea = (len(Va) - Va_most[0][1]) + (len(Vb) - Vb_most[1][1])

    typeb = 10 ** 10

    if len(Va_most) >= 2:

        typeb = (len(Va) - Va_most[1][1]) + (len(Vb) - Vb_most[0][1])

    print((min(typea, typeb)))

    exit()



print(((len(Va) - Va_most[0][1]) + (len(Vb) - Vb_most[0][1])))
import itertools

from collections import Counter



N = int(eval(input()))

V = [int(x) for x in input().split()]

EV_cnt = Counter(V[::2])

OD_cnt = Counter(V[1::2])



EV_cnt[-1] = 0

OD_cnt[-2] = 0



EV = EV_cnt.most_common(2)

OD = OD_cnt.most_common(2)



ans = N

for (k1,v1), (k2,v2) in itertools.product(EV,OD):

    if k1 == k2:

        continue

    x = (N - v1 - v2)

    if ans > x:

        ans = x



print(ans)
import collections

N = int(eval(input()))
V = [int(x) for x in input().split()]
Va, Vb = [], []
for i in range(N):
    if i % 2 == 0:
        Va.append(V[i])
    else:
        Vb.append(V[i])
Va_most = collections.Counter(Va).most_common()
Vb_most = collections.Counter(Vb).most_common()
if N == collections.Counter(V).most_common()[0][1]:
    print((N // 2))
    exit()
if Va_most[0][0] == Vb_most[0][0]:
    typea = 10**10
    if len(Vb_most) >= 2:
        typea = (len(Va) - Va_most[0][1]) + (len(Vb) - Vb_most[1][1])
    typeb = 10**10
    if len(Va_most) >= 2:
        typeb = (len(Va) - Va_most[1][1]) + (len(Vb) - Vb_most[0][1])
    print((min(typea, typeb)))
    exit()
print(((len(Va) - Va_most[0][1]) + (len(Vb) - Vb_most[0][1])))

import itertools
from collections import Counter

N = int(eval(input()))
V = [int(x) for x in input().split()]
EV_cnt = Counter(V[::2])
OD_cnt = Counter(V[1::2])
EV_cnt[-1] = 0
OD_cnt[-2] = 0
EV = EV_cnt.most_common(2)
OD = OD_cnt.most_common(2)
ans = N
for (k1, v1), (k2, v2) in itertools.product(EV, OD):
    if k1 == k2:
        continue
    x = N - v1 - v2
    if ans > x:
        ans = x
print(ans)

-import collections +import itertools +from collections import Counter -Va, Vb = [], [] -for i in range(N): -    if i % 2 == 0: -        Va.append(V[i]) -    else: -        Vb.append(V[i]) -Va_most = collections.Counter(Va).most_common() -Vb_most = collections.Counter(Vb).most_common() -if N == collections.Counter(V).most_common()[0][1]: -    print((N // 2)) -    exit() -if Va_most[0][0] == Vb_most[0][0]: -    typea = 10**10 -    if len(Vb_most) >= 2: -        typea = (len(Va) - Va_most[0][1]) + (len(Vb) - Vb_most[1][1]) -    typeb = 10**10 -    if len(Va_most) >= 2: -        typeb = (len(Va) - Va_most[1][1]) + (len(Vb) - Vb_most[0][1]) -    print((min(typea, typeb))) -    exit() -print(((len(Va) - Va_most[0][1]) + (len(Vb) - Vb_most[0][1]))) +EV_cnt = Counter(V[::2]) +OD_cnt = Counter(V[1::2]) +EV_cnt[-1] = 0 +OD_cnt[-2] = 0 +EV = EV_cnt.most_common(2) +OD = OD_cnt.most_common(2) +ans = N +for (k1, v1), (k2, v2) in itertools.product(EV, OD): +    if k1 == k2: +        continue +    x = N - v1 - v2 +    if ans > x: +        ans = x +print(ans)