N=int(eval(input()))

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

dev={}

dod={}

#cev=0#devの種類数

#cod=0#dodの種類数

max1_ev=[0,0]#数字,個数

max2_ev=[0,0]

max1_od=[0,0]#数字,個数

max2_od=[0,0]



for i in range(N):

    if i%2==0:#even

        #max1_ev=[0,0]#数字,個数

        #max2_ev=[0,0]

        #毎回初期化していた！！



        if lv[i] in dev:#辞書の更新

            dev[lv[i]]+=1

        else:

            dev[lv[i]]=1

            #maxの更新

            #cev+=1

            #if cev==1:

            #    max1_ev=[i,lv[i]]

            #elif cev==2:

            #    max2_ev=[i,lv[i]]

        ##3種目以降

        #最大個数の更新

        if dev[lv[i]]>max1_ev[1]:

            max1_ev=[lv[i],dev[lv[i]]]

        #elif dev[lv[i]]>max2_ev[1]:

        elif dev[lv[i]]>=max2_ev[1]:

            max2_ev=[lv[i],dev[lv[i]]]

        #print("dev[lv[i]]",dev[lv[i]])

        #print("max1__ev[1]",max1_ev[1])

        #print("max1_ev",max1_ev)

        #print("max2_ev",max2_ev)

        #if i==0:

        #    max1=[0,1]

        #elif i==1:

        #    max2

    else:#odd

        #max1_od=[0,0]

        #max2_od=[0,0]

        if lv[i] in dod:

            dod[lv[i]]+=1

        else:

            dod[lv[i]]=1

        if dod[lv[i]]>max1_od[1]:

            max1_od=[lv[i],dod[lv[i]]]

        #elif dod[lv[i]]>max2_od[1]:

        elif dod[lv[i]]>=max2_od[1]:

            max2_od=[lv[i],dod[lv[i]]]

#print("dev",dev)#ok

#print("dod",dod)#ok

#print("max1_ev",max1_ev)

#print("max2_ev",max2_ev)





#if len(dev)==1 and len(dod)==1:

#    print(int(N/2))

#elif len(dev)==1:

    #for i in range(len(dod)):

    #    if i==0:

    #        max1_od=

#    if max1_ev[0]!=max1_od[0]:

#        print(N-max1_ev[1]-max1_od[1])

##        print(max)

if max1_ev[0]!=max1_od[0]:

    print((N-max1_ev[1]-max1_od[1]))

elif len(dev)==1 and len(dod)==1:

    print((int(N/2)))

elif len(dev)==1:

    print((int(N/2)-max2_od[1]))

elif len(dod)==1:

    print((int(N/2)-max2_ev[1]))

else:

    #print(max(N-max1_ev[1]-max2_od[1],N-max2_ev[1]-max1_od[1]))#minをmaxとしていた

    print((min(N-max1_ev[1]-max2_od[1],N-max2_ev[1]-max1_od[1])))

N=int(eval(input()))

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

dev={}

dod={}

for i in range(N):

    if i%2==0:#even

        if lv[i] in dev:

            dev[lv[i]]+=1

        else:

            dev[lv[i]]=1

    else:#odd

        if lv[i] in dod:

            dod[lv[i]]+=1

        else:

            dod[lv[i]]=1



max1_ev=[0,0]

max2_ev=[0,0]

max1_od=[0,0]

max2_od=[0,0]

#for i in range(len(dev)):

for v in dev:#max even

    if dev[v]>max1_ev[1]:

        a=max1_ev

        max1_ev=[v,dev[v]]

        max2_ev=a

    elif dev[v]>max2_ev[1]:

        max2_ev=[v,dev[v]]

for v in dod:#max odd

    if dod[v]>max1_od[1]:

        a=max1_od

        max1_od=[v,dod[v]]

        max2_od=a

    elif dod[v]>max2_od[1]:

        max2_od=[v,dod[v]]

if max1_ev[0]!=max1_od[0]:

    print((N-max1_ev[1]-max1_od[1]))

else:

    print((min(N-max1_ev[1]-max2_od[1],N-max2_ev[1]-max1_od[1])))

N = int(eval(input()))
lv = list(map(int, input().split()))
dev = {}
dod = {}
# cev=0#devの種類数
# cod=0#dodの種類数
max1_ev = [0, 0]  # 数字,個数
max2_ev = [0, 0]
max1_od = [0, 0]  # 数字,個数
max2_od = [0, 0]
for i in range(N):
    if i % 2 == 0:  # even
        # max1_ev=[0,0]#数字,個数
        # max2_ev=[0,0]
        # 毎回初期化していた！！
        if lv[i] in dev:  # 辞書の更新
            dev[lv[i]] += 1
        else:
            dev[lv[i]] = 1
            # maxの更新
            # cev+=1
            # if cev==1:
            #    max1_ev=[i,lv[i]]
            # elif cev==2:
            #    max2_ev=[i,lv[i]]
        ##3種目以降
        # 最大個数の更新
        if dev[lv[i]] > max1_ev[1]:
            max1_ev = [lv[i], dev[lv[i]]]
        # elif dev[lv[i]]>max2_ev[1]:
        elif dev[lv[i]] >= max2_ev[1]:
            max2_ev = [lv[i], dev[lv[i]]]
        # print("dev[lv[i]]",dev[lv[i]])
        # print("max1__ev[1]",max1_ev[1])
        # print("max1_ev",max1_ev)
        # print("max2_ev",max2_ev)
        # if i==0:
        #    max1=[0,1]
        # elif i==1:
        #    max2
    else:  # odd
        # max1_od=[0,0]
        # max2_od=[0,0]
        if lv[i] in dod:
            dod[lv[i]] += 1
        else:
            dod[lv[i]] = 1
        if dod[lv[i]] > max1_od[1]:
            max1_od = [lv[i], dod[lv[i]]]
        # elif dod[lv[i]]>max2_od[1]:
        elif dod[lv[i]] >= max2_od[1]:
            max2_od = [lv[i], dod[lv[i]]]
# print("dev",dev)#ok
# print("dod",dod)#ok
# print("max1_ev",max1_ev)
# print("max2_ev",max2_ev)
# if len(dev)==1 and len(dod)==1:
#    print(int(N/2))
# elif len(dev)==1:
# for i in range(len(dod)):
#    if i==0:
#        max1_od=
#    if max1_ev[0]!=max1_od[0]:
#        print(N-max1_ev[1]-max1_od[1])
##        print(max)
if max1_ev[0] != max1_od[0]:
    print((N - max1_ev[1] - max1_od[1]))
elif len(dev) == 1 and len(dod) == 1:
    print((int(N / 2)))
elif len(dev) == 1:
    print((int(N / 2) - max2_od[1]))
elif len(dod) == 1:
    print((int(N / 2) - max2_ev[1]))
else:
    # print(max(N-max1_ev[1]-max2_od[1],N-max2_ev[1]-max1_od[1]))#minをmaxとしていた
    print((min(N - max1_ev[1] - max2_od[1], N - max2_ev[1] - max1_od[1])))

N = int(eval(input()))
lv = list(map(int, input().split()))
dev = {}
dod = {}
for i in range(N):
    if i % 2 == 0:  # even
        if lv[i] in dev:
            dev[lv[i]] += 1
        else:
            dev[lv[i]] = 1
    else:  # odd
        if lv[i] in dod:
            dod[lv[i]] += 1
        else:
            dod[lv[i]] = 1
max1_ev = [0, 0]
max2_ev = [0, 0]
max1_od = [0, 0]
max2_od = [0, 0]
# for i in range(len(dev)):
for v in dev:  # max even
    if dev[v] > max1_ev[1]:
        a = max1_ev
        max1_ev = [v, dev[v]]
        max2_ev = a
    elif dev[v] > max2_ev[1]:
        max2_ev = [v, dev[v]]
for v in dod:  # max odd
    if dod[v] > max1_od[1]:
        a = max1_od
        max1_od = [v, dod[v]]
        max2_od = a
    elif dod[v] > max2_od[1]:
        max2_od = [v, dod[v]]
if max1_ev[0] != max1_od[0]:
    print((N - max1_ev[1] - max1_od[1]))
else:
    print((min(N - max1_ev[1] - max2_od[1], N - max2_ev[1] - max1_od[1])))

-# cev=0#devの種類数 -# cod=0#dodの種類数 -max1_ev = [0, 0]  # 数字,個数 -max2_ev = [0, 0] -max1_od = [0, 0]  # 数字,個数 -max2_od = [0, 0] -        # max1_ev=[0,0]#数字,個数 -        # max2_ev=[0,0] -        # 毎回初期化していた！！ -        if lv[i] in dev:  # 辞書の更新 +        if lv[i] in dev: -            # maxの更新 -            # cev+=1 -            # if cev==1: -            #    max1_ev=[i,lv[i]] -            # elif cev==2: -            #    max2_ev=[i,lv[i]] -        ##3種目以降 -        # 最大個数の更新 -        if dev[lv[i]] > max1_ev[1]: -            max1_ev = [lv[i], dev[lv[i]]] -        # elif dev[lv[i]]>max2_ev[1]: -        elif dev[lv[i]] >= max2_ev[1]: -            max2_ev = [lv[i], dev[lv[i]]] -        # print("dev[lv[i]]",dev[lv[i]]) -        # print("max1__ev[1]",max1_ev[1]) -        # print("max1_ev",max1_ev) -        # print("max2_ev",max2_ev) -        # if i==0: -        #    max1=[0,1] -        # elif i==1: -        #    max2 -        # max1_od=[0,0] -        # max2_od=[0,0] -        if dod[lv[i]] > max1_od[1]: -            max1_od = [lv[i], dod[lv[i]]] -        # elif dod[lv[i]]>max2_od[1]: -        elif dod[lv[i]] >= max2_od[1]: -            max2_od = [lv[i], dod[lv[i]]] -# print("dev",dev)#ok -# print("dod",dod)#ok -# print("max1_ev",max1_ev) -# print("max2_ev",max2_ev) -# if len(dev)==1 and len(dod)==1: -#    print(int(N/2)) -# elif len(dev)==1: -# for i in range(len(dod)): -#    if i==0: -#        max1_od= -#    if max1_ev[0]!=max1_od[0]: -#        print(N-max1_ev[1]-max1_od[1]) -##        print(max) +max1_ev = [0, 0] +max2_ev = [0, 0] +max1_od = [0, 0] +max2_od = [0, 0] +# for i in range(len(dev)): +for v in dev:  # max even +    if dev[v] > max1_ev[1]: +        a = max1_ev +        max1_ev = [v, dev[v]] +        max2_ev = a +    elif dev[v] > max2_ev[1]: +        max2_ev = [v, dev[v]] +for v in dod:  # max odd +    if dod[v] > max1_od[1]: +        a = max1_od +        max1_od = [v, dod[v]] +        max2_od = a +    elif dod[v] > max2_od[1]: +        max2_od = [v, dod[v]] -elif len(dev) == 1 and len(dod) == 1: -    print((int(N / 2))) -elif len(dev) == 1: -    print((int(N / 2) - max2_od[1])) -elif len(dod) == 1: -    print((int(N / 2) - max2_ev[1])) -    # print(max(N-max1_ev[1]-max2_od[1],N-max2_ev[1]-max1_od[1]))#minをmaxとしていた