from collections import Counter

n=int(eval(input()))

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

E=Counter(V[::2]).most_common()

O=Counter(V[1::2]).most_common()

if E[0][0]==O[0][0]:

	E2=Counter(V[1::2]).most_common()[1][1] if len(E)>1 else 0

	O2=Counter(V[::2]).most_common()[1][1] if len(O)>1 else 0 

print((n-E[0][1]-O[0][1] if E[0][0]!=O[0][0] else n-max(E[0][1]+E2,O[0][1]+O2)))
from collections import Counter

n=int(eval(input()))

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

E=Counter(V[::2]).most_common()+[(0,0)]

O=Counter(V[1::2]).most_common()+[(0,0)]

print((n-E[0][1]-O[0][1] if E[0][0]!=O[0][0] else n-max(E[0][1]+O[1][1],O[0][1]+E[1][1])))
from collections import Counter

n = int(eval(input()))
V = list(map(int, input().split()))
E = Counter(V[::2]).most_common()
O = Counter(V[1::2]).most_common()
if E[0][0] == O[0][0]:
    E2 = Counter(V[1::2]).most_common()[1][1] if len(E) > 1 else 0
    O2 = Counter(V[::2]).most_common()[1][1] if len(O) > 1 else 0
print(
    (
        n - E[0][1] - O[0][1]
        if E[0][0] != O[0][0]
        else n - max(E[0][1] + E2, O[0][1] + O2)
    )
)

from collections import Counter

n = int(eval(input()))
V = list(map(int, input().split()))
E = Counter(V[::2]).most_common() + [(0, 0)]
O = Counter(V[1::2]).most_common() + [(0, 0)]
print(
    (
        n - E[0][1] - O[0][1]
        if E[0][0] != O[0][0]
        else n - max(E[0][1] + O[1][1], O[0][1] + E[1][1])
    )
)

-E = Counter(V[::2]).most_common() -O = Counter(V[1::2]).most_common() -if E[0][0] == O[0][0]: -    E2 = Counter(V[1::2]).most_common()[1][1] if len(E) > 1 else 0 -    O2 = Counter(V[::2]).most_common()[1][1] if len(O) > 1 else 0 +E = Counter(V[::2]).most_common() + [(0, 0)] +O = Counter(V[1::2]).most_common() + [(0, 0)] -        else n - max(E[0][1] + E2, O[0][1] + O2) +        else n - max(E[0][1] + O[1][1], O[0][1] + E[1][1])