from collections import Counter

n = int(eval(input()))

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

E = []

O = []

for i,v in enumerate(V):

    if i%2==0:

        O.append(v)

    else:

        E.append(v)



cO = Counter(O).most_common(); cO.append((-1,0))

cE = Counter(E).most_common(); cE.append((-1,0))

if cO[0][0]==cE[0][0]: 

    ans = min(n-cO[0][1]-cE[1][1], n-cO[1][1]-cE[0][1])

else:

    ans = n-cO[0][1]-cE[0][1]

print(ans)
from collections import Counter

n = int(eval(input()))

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

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

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

cv1.append((-1,0)); cv2.append((-1,0))

if cv1[0][0] != cv2[0][0]:

    print((n-cv1[0][1]-cv2[0][1]))

else:

    print((min(n-cv1[1][1]-cv2[0][1], n-cv1[0][1]-cv2[1][1])))
from collections import Counter

n = int(eval(input()))
V = list(map(int, input().split()))
E = []
O = []
for i, v in enumerate(V):
    if i % 2 == 0:
        O.append(v)
    else:
        E.append(v)
cO = Counter(O).most_common()
cO.append((-1, 0))
cE = Counter(E).most_common()
cE.append((-1, 0))
if cO[0][0] == cE[0][0]:
    ans = min(n - cO[0][1] - cE[1][1], n - cO[1][1] - cE[0][1])
else:
    ans = n - cO[0][1] - cE[0][1]
print(ans)

from collections import Counter

n = int(eval(input()))
V = list(map(int, input().split()))
cv1 = Counter(V[::2]).most_common()
cv2 = Counter(V[1::2]).most_common()
cv1.append((-1, 0))
cv2.append((-1, 0))
if cv1[0][0] != cv2[0][0]:
    print((n - cv1[0][1] - cv2[0][1]))
else:
    print((min(n - cv1[1][1] - cv2[0][1], n - cv1[0][1] - cv2[1][1])))

-E = [] -O = [] -for i, v in enumerate(V): -    if i % 2 == 0: -        O.append(v) -    else: -        E.append(v) -cO = Counter(O).most_common() -cO.append((-1, 0)) -cE = Counter(E).most_common() -cE.append((-1, 0)) -if cO[0][0] == cE[0][0]: -    ans = min(n - cO[0][1] - cE[1][1], n - cO[1][1] - cE[0][1]) +cv1 = Counter(V[::2]).most_common() +cv2 = Counter(V[1::2]).most_common() +cv1.append((-1, 0)) +cv2.append((-1, 0)) +if cv1[0][0] != cv2[0][0]: +    print((n - cv1[0][1] - cv2[0][1])) -    ans = n - cO[0][1] - cE[0][1] -print(ans) +    print((min(n - cv1[1][1] - cv2[0][1], n - cv1[0][1] - cv2[1][1])))