n = int(eval(input()))

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

a = [0]*100000

b = [0]*100000

v1=[]

v2=[]



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

    print((n//2))



else:

    for i in range(n):

        if i%2 == 0:

            a[V[i]-1] += 1

            v1.append(V[i])

        else:

            b[V[i]-1] += 1

            v2.append(V[i])



    max1 = 0

    max2 = 0



    for j in range(len(a)):

        if max1 < a[j]:

            max1 = a[j]

            c1 = j

    for k in range(len(b)):

        if max2 < b[k]:

            max2=b[k]

            c2=k



    if c1 != c2:

        print((n-max1-max2))

    else:

        a.sort()

        b.sort()

        print((min(n-max1-b[-2],n-max2-a[-2])))

from collections import Counter

N = int(eval(input()))

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

zero = Counter(V[::2]).most_common()

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

if zero[0][0] != one[0][0]:

    print((N-zero[0][1]-one[0][1]))

else:

    if len(zero) == 1 and len(one) == 1:

        print((N//2))

    elif len(zero) == 1:

        print((N-zero[0][1]-one[1][1]))

    elif len(one) == 1:

        print((N-zero[1][1]-one[0][1]))

    else:

        print((min(N-zero[1][1]-one[0][1],N-zero[0][1]-one[1][1])))
n = int(eval(input()))
V = list(map(int, input().split()))
a = [0] * 100000
b = [0] * 100000
v1 = []
v2 = []
if len(set(V)) == 1:
    print((n // 2))
else:
    for i in range(n):
        if i % 2 == 0:
            a[V[i] - 1] += 1
            v1.append(V[i])
        else:
            b[V[i] - 1] += 1
            v2.append(V[i])
    max1 = 0
    max2 = 0
    for j in range(len(a)):
        if max1 < a[j]:
            max1 = a[j]
            c1 = j
    for k in range(len(b)):
        if max2 < b[k]:
            max2 = b[k]
            c2 = k
    if c1 != c2:
        print((n - max1 - max2))
    else:
        a.sort()
        b.sort()
        print((min(n - max1 - b[-2], n - max2 - a[-2])))

from collections import Counter

N = int(eval(input()))
V = list(map(int, input().split()))
zero = Counter(V[::2]).most_common()
one = Counter(V[1::2]).most_common()
if zero[0][0] != one[0][0]:
    print((N - zero[0][1] - one[0][1]))
else:
    if len(zero) == 1 and len(one) == 1:
        print((N // 2))
    elif len(zero) == 1:
        print((N - zero[0][1] - one[1][1]))
    elif len(one) == 1:
        print((N - zero[1][1] - one[0][1]))
    else:
        print((min(N - zero[1][1] - one[0][1], N - zero[0][1] - one[1][1])))

-n = int(eval(input())) +from collections import Counter + +N = int(eval(input())) -a = [0] * 100000 -b = [0] * 100000 -v1 = [] -v2 = [] -if len(set(V)) == 1: -    print((n // 2)) +zero = Counter(V[::2]).most_common() +one = Counter(V[1::2]).most_common() +if zero[0][0] != one[0][0]: +    print((N - zero[0][1] - one[0][1])) -    for i in range(n): -        if i % 2 == 0: -            a[V[i] - 1] += 1 -            v1.append(V[i]) -        else: -            b[V[i] - 1] += 1 -            v2.append(V[i]) -    max1 = 0 -    max2 = 0 -    for j in range(len(a)): -        if max1 < a[j]: -            max1 = a[j] -            c1 = j -    for k in range(len(b)): -        if max2 < b[k]: -            max2 = b[k] -            c2 = k -    if c1 != c2: -        print((n - max1 - max2)) +    if len(zero) == 1 and len(one) == 1: +        print((N // 2)) +    elif len(zero) == 1: +        print((N - zero[0][1] - one[1][1])) +    elif len(one) == 1: +        print((N - zero[1][1] - one[0][1])) -        a.sort() -        b.sort() -        print((min(n - max1 - b[-2], n - max2 - a[-2]))) +        print((min(N - zero[1][1] - one[0][1], N - zero[0][1] - one[1][1])))