N=int(eval(input()))

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

import collections



import collections



c1=collections.Counter(V[0::2])

c1=sorted(list(c1.items()), key=lambda x: x[1], reverse=True)

e=c1[0][0]



c2=collections.Counter(V[1::2])

c2=sorted(list(c2.items()), key=lambda x: x[1], reverse=True)

o=c2[0][0]



cnt=0

if e!=o:

    cnt=sum(e!=i for i in V[0::2])

    cnt+=sum(o!=i for i in V[1::2])

else:

    if len(c1)==1 and len(c2)==1:

        cnt=N//2

    elif len(c1)==1:

        cnt1=sum(e!=i for i in V[0::2])

        cnt1+=sum(c2[1][0]!=i for i in V[1::2])

        

        cnt2=sum(e!=i for i in V[0::2])

        cnt2+=sum(c2[1][1]!=i for i in V[1::2])

        cnt=min(cnt1,cnt2)

    elif len(c2)==1:

        cnt1=sum(c1[1][0]!=i for i in V[0::2])

        cnt1+=sum(o!=i for i in V[1::2])



        cnt2=sum(c1[1][1]!=i for i in V[0::2])

        cnt2+=sum(o!=i for i in V[1::2])

        cnt=min(cnt1,cnt2)

    else:    

        cnt1=sum(e!=i for i in V[0::2])

        cnt1+=sum(c2[1][0]!=i for i in V[1::2])

        

        cnt2=sum(c1[1][0]!=i for i in V[0::2])

        cnt2+=sum(o!=i for i in V[1::2])

        cnt=min(cnt1,cnt2)

print(cnt)
N=int(eval(input()))

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

import collections



c1=collections.Counter(V[0::2]).most_common()

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

c1.append([0,0])

c2.append([0,0])

if c1[0][0]!=c2[0][0]:

    print((N-c1[0][1]-c2[0][1]))

else:

    print((min(N-c1[0][1]-c2[1][1],N-c1[1][1]-c2[0][1])))
N = int(eval(input()))
(*V,) = list(map(int, input().split()))
import collections
import collections

c1 = collections.Counter(V[0::2])
c1 = sorted(list(c1.items()), key=lambda x: x[1], reverse=True)
e = c1[0][0]
c2 = collections.Counter(V[1::2])
c2 = sorted(list(c2.items()), key=lambda x: x[1], reverse=True)
o = c2[0][0]
cnt = 0
if e != o:
    cnt = sum(e != i for i in V[0::2])
    cnt += sum(o != i for i in V[1::2])
else:
    if len(c1) == 1 and len(c2) == 1:
        cnt = N // 2
    elif len(c1) == 1:
        cnt1 = sum(e != i for i in V[0::2])
        cnt1 += sum(c2[1][0] != i for i in V[1::2])
        cnt2 = sum(e != i for i in V[0::2])
        cnt2 += sum(c2[1][1] != i for i in V[1::2])
        cnt = min(cnt1, cnt2)
    elif len(c2) == 1:
        cnt1 = sum(c1[1][0] != i for i in V[0::2])
        cnt1 += sum(o != i for i in V[1::2])
        cnt2 = sum(c1[1][1] != i for i in V[0::2])
        cnt2 += sum(o != i for i in V[1::2])
        cnt = min(cnt1, cnt2)
    else:
        cnt1 = sum(e != i for i in V[0::2])
        cnt1 += sum(c2[1][0] != i for i in V[1::2])
        cnt2 = sum(c1[1][0] != i for i in V[0::2])
        cnt2 += sum(o != i for i in V[1::2])
        cnt = min(cnt1, cnt2)
print(cnt)

N = int(eval(input()))
(*V,) = list(map(int, input().split()))
import collections

c1 = collections.Counter(V[0::2]).most_common()
c2 = collections.Counter(V[1::2]).most_common()
c1.append([0, 0])
c2.append([0, 0])
if c1[0][0] != c2[0][0]:
    print((N - c1[0][1] - c2[0][1]))
else:
    print((min(N - c1[0][1] - c2[1][1], N - c1[1][1] - c2[0][1])))

-import collections -c1 = collections.Counter(V[0::2]) -c1 = sorted(list(c1.items()), key=lambda x: x[1], reverse=True) -e = c1[0][0] -c2 = collections.Counter(V[1::2]) -c2 = sorted(list(c2.items()), key=lambda x: x[1], reverse=True) -o = c2[0][0] -cnt = 0 -if e != o: -    cnt = sum(e != i for i in V[0::2]) -    cnt += sum(o != i for i in V[1::2]) +c1 = collections.Counter(V[0::2]).most_common() +c2 = collections.Counter(V[1::2]).most_common() +c1.append([0, 0]) +c2.append([0, 0]) +if c1[0][0] != c2[0][0]: +    print((N - c1[0][1] - c2[0][1])) -    if len(c1) == 1 and len(c2) == 1: -        cnt = N // 2 -    elif len(c1) == 1: -        cnt1 = sum(e != i for i in V[0::2]) -        cnt1 += sum(c2[1][0] != i for i in V[1::2]) -        cnt2 = sum(e != i for i in V[0::2]) -        cnt2 += sum(c2[1][1] != i for i in V[1::2]) -        cnt = min(cnt1, cnt2) -    elif len(c2) == 1: -        cnt1 = sum(c1[1][0] != i for i in V[0::2]) -        cnt1 += sum(o != i for i in V[1::2]) -        cnt2 = sum(c1[1][1] != i for i in V[0::2]) -        cnt2 += sum(o != i for i in V[1::2]) -        cnt = min(cnt1, cnt2) -    else: -        cnt1 = sum(e != i for i in V[0::2]) -        cnt1 += sum(c2[1][0] != i for i in V[1::2]) -        cnt2 = sum(c1[1][0] != i for i in V[0::2]) -        cnt2 += sum(o != i for i in V[1::2]) -        cnt = min(cnt1, cnt2) -print(cnt) +    print((min(N - c1[0][1] - c2[1][1], N - c1[1][1] - c2[0][1])))