iN = int(eval(input()))

aV = [int(_) for _ in input().split()]



aV0={}

aV1={}

for i in range(iN):

    iA = aV[i]

    if i % 2 == 0:

        if iA in aV0:

            aV0[iA] += 1

        else:

            aV0[iA] = 1

    else:

        if iA in aV1:

            aV1[iA] += 1

        else:

            aV1[iA] = 1

aV0[0]=0

aV1[0]=0



aV0dec = sorted(aV0,key=aV0.get,reverse=True)

aV1dec = sorted(aV1,key=aV1.get,reverse=True)



iMax1aV0 = aV0dec[0]

iMax1aV1 = aV1dec[0]



if iMax1aV0 != iMax1aV1:

    print((iN - aV0[iMax1aV0] - aV1[iMax1aV1]))

else:

    print((iN - max(aV0[iMax1aV0],aV1[iMax1aV1]) - max(aV0[aV0dec[1]],aV1[aV1dec[1]])))

from collections import Counter



iN = int(eval(input()))

aV = [int(_) for _ in input().split()]



oV0 = Counter(aV[0::2]).most_common()

oV1 = Counter(aV[1::2]).most_common()

oV0 += [(0,0)]

oV1 += [(0,0)]



if oV0[0][0] != oV1[0][0] :

    print((iN - oV0[0][1] - oV1[0][1]))

else:

    print((iN - max(oV0[0][1],oV1[0][1]) - max(oV0[1][1],oV1[1][1])))

iN = int(eval(input()))
aV = [int(_) for _ in input().split()]
aV0 = {}
aV1 = {}
for i in range(iN):
    iA = aV[i]
    if i % 2 == 0:
        if iA in aV0:
            aV0[iA] += 1
        else:
            aV0[iA] = 1
    else:
        if iA in aV1:
            aV1[iA] += 1
        else:
            aV1[iA] = 1
aV0[0] = 0
aV1[0] = 0
aV0dec = sorted(aV0, key=aV0.get, reverse=True)
aV1dec = sorted(aV1, key=aV1.get, reverse=True)
iMax1aV0 = aV0dec[0]
iMax1aV1 = aV1dec[0]
if iMax1aV0 != iMax1aV1:
    print((iN - aV0[iMax1aV0] - aV1[iMax1aV1]))
else:
    print(
        (iN - max(aV0[iMax1aV0], aV1[iMax1aV1]) - max(aV0[aV0dec[1]], aV1[aV1dec[1]]))
    )

from collections import Counter

iN = int(eval(input()))
aV = [int(_) for _ in input().split()]
oV0 = Counter(aV[0::2]).most_common()
oV1 = Counter(aV[1::2]).most_common()
oV0 += [(0, 0)]
oV1 += [(0, 0)]
if oV0[0][0] != oV1[0][0]:
    print((iN - oV0[0][1] - oV1[0][1]))
else:
    print((iN - max(oV0[0][1], oV1[0][1]) - max(oV0[1][1], oV1[1][1])))

+from collections import Counter + -aV0 = {} -aV1 = {} -for i in range(iN): -    iA = aV[i] -    if i % 2 == 0: -        if iA in aV0: -            aV0[iA] += 1 -        else: -            aV0[iA] = 1 -    else: -        if iA in aV1: -            aV1[iA] += 1 -        else: -            aV1[iA] = 1 -aV0[0] = 0 -aV1[0] = 0 -aV0dec = sorted(aV0, key=aV0.get, reverse=True) -aV1dec = sorted(aV1, key=aV1.get, reverse=True) -iMax1aV0 = aV0dec[0] -iMax1aV1 = aV1dec[0] -if iMax1aV0 != iMax1aV1: -    print((iN - aV0[iMax1aV0] - aV1[iMax1aV1])) +oV0 = Counter(aV[0::2]).most_common() +oV1 = Counter(aV[1::2]).most_common() +oV0 += [(0, 0)] +oV1 += [(0, 0)] +if oV0[0][0] != oV1[0][0]: +    print((iN - oV0[0][1] - oV1[0][1])) -    print( -        (iN - max(aV0[iMax1aV0], aV1[iMax1aV1]) - max(aV0[aV0dec[1]], aV1[aV1dec[1]])) -    ) +    print((iN - max(oV0[0][1], oV1[0][1]) - max(oV0[1][1], oV1[1][1])))