from collections import Counter

n=int(eval(input()))

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



A=v[0::2]

B=v[1::2]

a=len(A)

b=len(B)



#print(Counter(A).most_common()[0][0])

#print(Counter(B).most_common()[0][0])



if Counter(A).most_common()[0][0] !=Counter(B).most_common()[0][0]:

    s=Counter(A).most_common()[0][1]

    t=Counter(B).most_common()[0][1]

    print(( (a-s)+(b-t)))

else:

  r=a

  s=b

  if Counter(A).most_common()[0][1]<a:

    o=Counter(A).most_common()[1][1]

    p=Counter(B).most_common()[0][1]

    r= (a-o)+(b-p)

  if Counter(B).most_common()[0][1]<b:

    w=Counter(A).most_common()[0][1]

    x=Counter(B).most_common()[1][1]

    s= (a-w)+(b-x)

  print((min( r, s)))

from collections import Counter

n=int(eval(input()))

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

b=[a[i] for i in range(n) if i%2==0]

c=[a[i] for i in range(n) if i%2==1]

b2=Counter(b)

c2=Counter(c)

b3=b2.most_common(2)

c3=c2.most_common(2)

ans=n

for i in b3:

    for j in c3:

        if i[0]!=j[0]:

            ans=min(ans,n-i[1]-j[1])

        else:

            ans=min(ans,n-max(i[1],j[1]))

print(ans)

from collections import Counter

n = int(eval(input()))
v = list(map(int, input().split()))
A = v[0::2]
B = v[1::2]
a = len(A)
b = len(B)
# print(Counter(A).most_common()[0][0])
# print(Counter(B).most_common()[0][0])
if Counter(A).most_common()[0][0] != Counter(B).most_common()[0][0]:
    s = Counter(A).most_common()[0][1]
    t = Counter(B).most_common()[0][1]
    print(((a - s) + (b - t)))
else:
    r = a
    s = b
    if Counter(A).most_common()[0][1] < a:
        o = Counter(A).most_common()[1][1]
        p = Counter(B).most_common()[0][1]
        r = (a - o) + (b - p)
    if Counter(B).most_common()[0][1] < b:
        w = Counter(A).most_common()[0][1]
        x = Counter(B).most_common()[1][1]
        s = (a - w) + (b - x)
    print((min(r, s)))

from collections import Counter

n = int(eval(input()))
a = list(map(int, input().split()))
b = [a[i] for i in range(n) if i % 2 == 0]
c = [a[i] for i in range(n) if i % 2 == 1]
b2 = Counter(b)
c2 = Counter(c)
b3 = b2.most_common(2)
c3 = c2.most_common(2)
ans = n
for i in b3:
    for j in c3:
        if i[0] != j[0]:
            ans = min(ans, n - i[1] - j[1])
        else:
            ans = min(ans, n - max(i[1], j[1]))
print(ans)

-v = list(map(int, input().split())) -A = v[0::2] -B = v[1::2] -a = len(A) -b = len(B) -# print(Counter(A).most_common()[0][0]) -# print(Counter(B).most_common()[0][0]) -if Counter(A).most_common()[0][0] != Counter(B).most_common()[0][0]: -    s = Counter(A).most_common()[0][1] -    t = Counter(B).most_common()[0][1] -    print(((a - s) + (b - t))) -else: -    r = a -    s = b -    if Counter(A).most_common()[0][1] < a: -        o = Counter(A).most_common()[1][1] -        p = Counter(B).most_common()[0][1] -        r = (a - o) + (b - p) -    if Counter(B).most_common()[0][1] < b: -        w = Counter(A).most_common()[0][1] -        x = Counter(B).most_common()[1][1] -        s = (a - w) + (b - x) -    print((min(r, s))) +a = list(map(int, input().split())) +b = [a[i] for i in range(n) if i % 2 == 0] +c = [a[i] for i in range(n) if i % 2 == 1] +b2 = Counter(b) +c2 = Counter(c) +b3 = b2.most_common(2) +c3 = c2.most_common(2) +ans = n +for i in b3: +    for j in c3: +        if i[0] != j[0]: +            ans = min(ans, n - i[1] - j[1]) +        else: +            ans = min(ans, n - max(i[1], j[1])) +print(ans)