import collections

n = int(eval(input()))

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

E,O = [],[]

E_cnt2,O_cnt2 = 0,0

for i in range(n):

    if i%2:

        E.append(V[i])

    else:

        O.append(V[i])

e = collections.Counter(E)

tmp = e.most_common()

E_mode,E_cnt = tmp[0][0],tmp[0][1]

if len(tmp)>=2:

    E_cnt2 = tmp[1][1]



o = collections.Counter(O)

tmp = o.most_common()

O_mode,O_cnt = tmp[0][0],tmp[0][1]

if len(tmp)>=2:

    O_cnt2 = tmp[1][1]

if E_mode!=O_mode:

    print((len(E)-E_cnt+len(O)-O_cnt))

else:

    print((min((len(E)-E_cnt+len(O)-O_cnt2),len(E)-E_cnt2+len(O)-O_cnt)))





import collections

n = int(eval(input()))

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

kisu = []

gusu = []



kisu = v[::2]

gusu = v[1::2]



kisu_cnt = collections.Counter(kisu)

gusu_cnt = collections.Counter(gusu)



kisu_cnt = kisu_cnt.most_common(2)#引数にnを用意すると，出現回数の多い順にn子だけ呼び出せる

gusu_cnt = gusu_cnt.most_common(2)

kisu_most  = 0

gusu_most = 0

if kisu_cnt[0][0]!=gusu_cnt[0][0]:

    print((n-kisu_cnt[0][1]-gusu_cnt[0][1]))

    exit()

else:

    if len(kisu_cnt)==1 or len(gusu_cnt)==1:

        print((n//2))

        exit()

    else:

        print((n-max(kisu_cnt[0][1]+gusu_cnt[1][1],kisu_cnt[1][1]+gusu_cnt[0][1])))
import collections

n = int(eval(input()))
V = [int(i) for i in input().split()]
E, O = [], []
E_cnt2, O_cnt2 = 0, 0
for i in range(n):
    if i % 2:
        E.append(V[i])
    else:
        O.append(V[i])
e = collections.Counter(E)
tmp = e.most_common()
E_mode, E_cnt = tmp[0][0], tmp[0][1]
if len(tmp) >= 2:
    E_cnt2 = tmp[1][1]
o = collections.Counter(O)
tmp = o.most_common()
O_mode, O_cnt = tmp[0][0], tmp[0][1]
if len(tmp) >= 2:
    O_cnt2 = tmp[1][1]
if E_mode != O_mode:
    print((len(E) - E_cnt + len(O) - O_cnt))
else:
    print((min((len(E) - E_cnt + len(O) - O_cnt2), len(E) - E_cnt2 + len(O) - O_cnt)))

import collections

n = int(eval(input()))
v = [int(i) for i in input().split()]
kisu = []
gusu = []
kisu = v[::2]
gusu = v[1::2]
kisu_cnt = collections.Counter(kisu)
gusu_cnt = collections.Counter(gusu)
kisu_cnt = kisu_cnt.most_common(2)  # 引数にnを用意すると，出現回数の多い順にn子だけ呼び出せる
gusu_cnt = gusu_cnt.most_common(2)
kisu_most = 0
gusu_most = 0
if kisu_cnt[0][0] != gusu_cnt[0][0]:
    print((n - kisu_cnt[0][1] - gusu_cnt[0][1]))
    exit()
else:
    if len(kisu_cnt) == 1 or len(gusu_cnt) == 1:
        print((n // 2))
        exit()
    else:
        print(
            (n - max(kisu_cnt[0][1] + gusu_cnt[1][1], kisu_cnt[1][1] + gusu_cnt[0][1]))
        )

-V = [int(i) for i in input().split()] -E, O = [], [] -E_cnt2, O_cnt2 = 0, 0 -for i in range(n): -    if i % 2: -        E.append(V[i]) +v = [int(i) for i in input().split()] +kisu = [] +gusu = [] +kisu = v[::2] +gusu = v[1::2] +kisu_cnt = collections.Counter(kisu) +gusu_cnt = collections.Counter(gusu) +kisu_cnt = kisu_cnt.most_common(2)  # 引数にnを用意すると，出現回数の多い順にn子だけ呼び出せる +gusu_cnt = gusu_cnt.most_common(2) +kisu_most = 0 +gusu_most = 0 +if kisu_cnt[0][0] != gusu_cnt[0][0]: +    print((n - kisu_cnt[0][1] - gusu_cnt[0][1])) +    exit() +else: +    if len(kisu_cnt) == 1 or len(gusu_cnt) == 1: +        print((n // 2)) +        exit() -        O.append(V[i]) -e = collections.Counter(E) -tmp = e.most_common() -E_mode, E_cnt = tmp[0][0], tmp[0][1] -if len(tmp) >= 2: -    E_cnt2 = tmp[1][1] -o = collections.Counter(O) -tmp = o.most_common() -O_mode, O_cnt = tmp[0][0], tmp[0][1] -if len(tmp) >= 2: -    O_cnt2 = tmp[1][1] -if E_mode != O_mode: -    print((len(E) - E_cnt + len(O) - O_cnt)) -else: -    print((min((len(E) - E_cnt + len(O) - O_cnt2), len(E) - E_cnt2 + len(O) - O_cnt))) +        print( +            (n - max(kisu_cnt[0][1] + gusu_cnt[1][1], kisu_cnt[1][1] + gusu_cnt[0][1])) +        )