from collections import Counter



n=int(eval(input()))

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

V_1=[(0,0)]+sorted(list(Counter([V[i] for i in range(n) if i%2==0]).items()), key=lambda x:x[1])

V_2=[(0,0)]+sorted(list(Counter([V[j] for j in range(n) if j%2==1]).items()), key=lambda x:x[1])



a,b=V_1[-1][0],V_2[-1][0]



if a==b:

    if V_1[-2][1]>V_2[-2][1]:a=V_1[-2][0]

    else:b=V_2[-2][0]



cnt=0

for i in range(n):

    if i%2==0:

        if V[i]!=a:cnt +=1

    else:

        if V[i]!=b:cnt +=1



print(cnt)
from collections import Counter

n=int(eval(input()))

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



even=[(0,0)]+sorted(list(Counter(V[::2]).items()), key=lambda x:x[1])

odd=[(0,0)]+sorted(list(Counter(V[1::2]).items()), key=lambda x:x[1])



if even[-1][0]==odd[-1][0]:

    if even[-2][1]>odd[-2][1]:even=even[-2][0];odd=odd[-1][0]

    else:even=even[-1][0];odd=odd[-2][0]

else:even=even[-1][0];odd=odd[-1][0]



cnt=0

for i,j in enumerate(V):

    if i%2==0 and j!=even:cnt +=1

    elif i%2==1 and j!=odd:cnt +=1



print(cnt)
from collections import Counter

n = int(eval(input()))
V = list(map(int, input().split()))
V_1 = [(0, 0)] + sorted(
    list(Counter([V[i] for i in range(n) if i % 2 == 0]).items()), key=lambda x: x[1]
)
V_2 = [(0, 0)] + sorted(
    list(Counter([V[j] for j in range(n) if j % 2 == 1]).items()), key=lambda x: x[1]
)
a, b = V_1[-1][0], V_2[-1][0]
if a == b:
    if V_1[-2][1] > V_2[-2][1]:
        a = V_1[-2][0]
    else:
        b = V_2[-2][0]
cnt = 0
for i in range(n):
    if i % 2 == 0:
        if V[i] != a:
            cnt += 1
    else:
        if V[i] != b:
            cnt += 1
print(cnt)

from collections import Counter

n = int(eval(input()))
V = list(map(int, input().split()))
even = [(0, 0)] + sorted(list(Counter(V[::2]).items()), key=lambda x: x[1])
odd = [(0, 0)] + sorted(list(Counter(V[1::2]).items()), key=lambda x: x[1])
if even[-1][0] == odd[-1][0]:
    if even[-2][1] > odd[-2][1]:
        even = even[-2][0]
        odd = odd[-1][0]
    else:
        even = even[-1][0]
        odd = odd[-2][0]
else:
    even = even[-1][0]
    odd = odd[-1][0]
cnt = 0
for i, j in enumerate(V):
    if i % 2 == 0 and j != even:
        cnt += 1
    elif i % 2 == 1 and j != odd:
        cnt += 1
print(cnt)

-V_1 = [(0, 0)] + sorted( -    list(Counter([V[i] for i in range(n) if i % 2 == 0]).items()), key=lambda x: x[1] -) -V_2 = [(0, 0)] + sorted( -    list(Counter([V[j] for j in range(n) if j % 2 == 1]).items()), key=lambda x: x[1] -) -a, b = V_1[-1][0], V_2[-1][0] -if a == b: -    if V_1[-2][1] > V_2[-2][1]: -        a = V_1[-2][0] +even = [(0, 0)] + sorted(list(Counter(V[::2]).items()), key=lambda x: x[1]) +odd = [(0, 0)] + sorted(list(Counter(V[1::2]).items()), key=lambda x: x[1]) +if even[-1][0] == odd[-1][0]: +    if even[-2][1] > odd[-2][1]: +        even = even[-2][0] +        odd = odd[-1][0] -        b = V_2[-2][0] +        even = even[-1][0] +        odd = odd[-2][0] +else: +    even = even[-1][0] +    odd = odd[-1][0] -for i in range(n): -    if i % 2 == 0: -        if V[i] != a: -            cnt += 1 -    else: -        if V[i] != b: -            cnt += 1 +for i, j in enumerate(V): +    if i % 2 == 0 and j != even: +        cnt += 1 +    elif i % 2 == 1 and j != odd: +        cnt += 1