from collections import Counter

N = int(eval(input()))

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

E = []

O = []

for k in range(N):

    if k%2 == 0:

        E.append(a[k])

    else:

        O.append(a[k])

e = Counter(E).most_common()

o = Counter(O).most_common()



if e[0][0] != o[0][0]:

    print((N-e[0][1]-o[0][1]))

else:

    if len(e) >= 2 and len(o) >= 2:

        print((N-e[0][1]-max(e[1][1],o[1][1])))

    elif len(e) >= 2 and len(o) == 1:

        print((N//2-e[1][1]))

    elif len(e) == 1 and len(o) >= 2:

        print((N//2-o[1][1]))

    else:

        print((N//2))

from collections import Counter

n = int(eval(input()))

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

e = [a[k] for k in range(0,n,2)]

o = [a[k] for k in range(1,n,2)]

C = Counter(e).most_common()

D = Counter(o).most_common()

if C[0][0] != D[0][0]:

    print((n-C[0][1]-D[0][1]))

else:

    if len(C) == len(D) == 1:

        print((n//2))

    elif len(C) == 1 and len(D) > 1:

        print((n-C[0][1]-D[1][1]))

    elif len(D) == 1 and len(C) > 1:

        print((n-D[0][1]-C[1][1]))

    else:

        print((n-max(D[0][1]+C[1][1],C[0][1]+D[1][1])))

from collections import Counter

N = int(eval(input()))
a = list(map(int, input().split()))
E = []
O = []
for k in range(N):
    if k % 2 == 0:
        E.append(a[k])
    else:
        O.append(a[k])
e = Counter(E).most_common()
o = Counter(O).most_common()
if e[0][0] != o[0][0]:
    print((N - e[0][1] - o[0][1]))
else:
    if len(e) >= 2 and len(o) >= 2:
        print((N - e[0][1] - max(e[1][1], o[1][1])))
    elif len(e) >= 2 and len(o) == 1:
        print((N // 2 - e[1][1]))
    elif len(e) == 1 and len(o) >= 2:
        print((N // 2 - o[1][1]))
    else:
        print((N // 2))

from collections import Counter

n = int(eval(input()))
a = list(map(int, input().split()))
e = [a[k] for k in range(0, n, 2)]
o = [a[k] for k in range(1, n, 2)]
C = Counter(e).most_common()
D = Counter(o).most_common()
if C[0][0] != D[0][0]:
    print((n - C[0][1] - D[0][1]))
else:
    if len(C) == len(D) == 1:
        print((n // 2))
    elif len(C) == 1 and len(D) > 1:
        print((n - C[0][1] - D[1][1]))
    elif len(D) == 1 and len(C) > 1:
        print((n - D[0][1] - C[1][1]))
    else:
        print((n - max(D[0][1] + C[1][1], C[0][1] + D[1][1])))

-N = int(eval(input())) +n = int(eval(input())) -E = [] -O = [] -for k in range(N): -    if k % 2 == 0: -        E.append(a[k]) +e = [a[k] for k in range(0, n, 2)] +o = [a[k] for k in range(1, n, 2)] +C = Counter(e).most_common() +D = Counter(o).most_common() +if C[0][0] != D[0][0]: +    print((n - C[0][1] - D[0][1])) +else: +    if len(C) == len(D) == 1: +        print((n // 2)) +    elif len(C) == 1 and len(D) > 1: +        print((n - C[0][1] - D[1][1])) +    elif len(D) == 1 and len(C) > 1: +        print((n - D[0][1] - C[1][1])) -        O.append(a[k]) -e = Counter(E).most_common() -o = Counter(O).most_common() -if e[0][0] != o[0][0]: -    print((N - e[0][1] - o[0][1])) -else: -    if len(e) >= 2 and len(o) >= 2: -        print((N - e[0][1] - max(e[1][1], o[1][1]))) -    elif len(e) >= 2 and len(o) == 1: -        print((N // 2 - e[1][1])) -    elif len(e) == 1 and len(o) >= 2: -        print((N // 2 - o[1][1])) -    else: -        print((N // 2)) +        print((n - max(D[0][1] + C[1][1], C[0][1] + D[1][1])))