from collections import Counter

n = int(eval(input()))

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

if len(set(array)) == 1:

    print((n//2))

    exit()

gu = []

ki = []

for i in range(n):

    if i % 2 == 0:

        gu.append(array[i])

    else:

        ki.append(array[i])

gu_c = Counter(gu)

ki_c = Counter(ki)

if gu_c.most_common()[0][0] != ki_c.most_common()[0][0]:

    print((n-(gu_c.most_common()[0][1]+ki_c.most_common()[0][1])))

elif gu_c.most_common()[0][1] < ki_c.most_common()[0][1]:

    print((n-(gu_c.most_common()[1][1]+ki_c.most_common()[0][1])))

elif gu_c.most_common()[0][1] > ki_c.most_common()[0][1]:

    print((n-(gu_c.most_common()[0][1]+ki_c.most_common()[1][1])))

else:

    print((n-(gu_c.most_common()[0][1]+max(gu_c.most_common()[1][1],ki_c.most_common()[1][1]))))
from collections import Counter

n = int(eval(input()))

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

if len(set(array)) == 1:

    print((n//2))

    exit()

gu = []

ki = []

for i in range(n):

    if i % 2 == 0:

        gu.append(array[i])

    else:

        ki.append(array[i])

gu_c = Counter(gu)

ki_c = Counter(ki)

gu_m = gu_c.most_common()

ki_m = ki_c.most_common()

if gu_m[0][0] != ki_m[0][0]:

    print((n-(gu_m[0][1]+ki_m[0][1])))

elif gu_m[0][1] < ki_m[0][1]:

    print((n-(gu_m[1][1]+ki_m[0][1])))

elif gu_m[0][1] > ki_m[0][1]:

    print((n-(gu_m[0][1]+ki_m[1][1])))

else:

    print((n-(gu_m[0][1]+max(gu_m[1][1],ki_m[1][1]))))
from collections import Counter

n = int(eval(input()))
array = list(map(int, input().split()))
if len(set(array)) == 1:
    print((n // 2))
    exit()
gu = []
ki = []
for i in range(n):
    if i % 2 == 0:
        gu.append(array[i])
    else:
        ki.append(array[i])
gu_c = Counter(gu)
ki_c = Counter(ki)
if gu_c.most_common()[0][0] != ki_c.most_common()[0][0]:
    print((n - (gu_c.most_common()[0][1] + ki_c.most_common()[0][1])))
elif gu_c.most_common()[0][1] < ki_c.most_common()[0][1]:
    print((n - (gu_c.most_common()[1][1] + ki_c.most_common()[0][1])))
elif gu_c.most_common()[0][1] > ki_c.most_common()[0][1]:
    print((n - (gu_c.most_common()[0][1] + ki_c.most_common()[1][1])))
else:
    print(
        (
            n
            - (
                gu_c.most_common()[0][1]
                + max(gu_c.most_common()[1][1], ki_c.most_common()[1][1])
            )
        )
    )

from collections import Counter

n = int(eval(input()))
array = list(map(int, input().split()))
if len(set(array)) == 1:
    print((n // 2))
    exit()
gu = []
ki = []
for i in range(n):
    if i % 2 == 0:
        gu.append(array[i])
    else:
        ki.append(array[i])
gu_c = Counter(gu)
ki_c = Counter(ki)
gu_m = gu_c.most_common()
ki_m = ki_c.most_common()
if gu_m[0][0] != ki_m[0][0]:
    print((n - (gu_m[0][1] + ki_m[0][1])))
elif gu_m[0][1] < ki_m[0][1]:
    print((n - (gu_m[1][1] + ki_m[0][1])))
elif gu_m[0][1] > ki_m[0][1]:
    print((n - (gu_m[0][1] + ki_m[1][1])))
else:
    print((n - (gu_m[0][1] + max(gu_m[1][1], ki_m[1][1]))))

-if gu_c.most_common()[0][0] != ki_c.most_common()[0][0]: -    print((n - (gu_c.most_common()[0][1] + ki_c.most_common()[0][1]))) -elif gu_c.most_common()[0][1] < ki_c.most_common()[0][1]: -    print((n - (gu_c.most_common()[1][1] + ki_c.most_common()[0][1]))) -elif gu_c.most_common()[0][1] > ki_c.most_common()[0][1]: -    print((n - (gu_c.most_common()[0][1] + ki_c.most_common()[1][1]))) +gu_m = gu_c.most_common() +ki_m = ki_c.most_common() +if gu_m[0][0] != ki_m[0][0]: +    print((n - (gu_m[0][1] + ki_m[0][1]))) +elif gu_m[0][1] < ki_m[0][1]: +    print((n - (gu_m[1][1] + ki_m[0][1]))) +elif gu_m[0][1] > ki_m[0][1]: +    print((n - (gu_m[0][1] + ki_m[1][1]))) -    print( -        ( -            n -            - ( -                gu_c.most_common()[0][1] -                + max(gu_c.most_common()[1][1], ki_c.most_common()[1][1]) -            ) -        ) -    ) +    print((n - (gu_m[0][1] + max(gu_m[1][1], ki_m[1][1]))))