from collections import Counter



N = int(eval(input()))

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



s1 = Counter(V).most_common(2)[0]

s2 = Counter(V).most_common(2)[0]

V1 = V[0::2]

V2 = V[1::2]

c1 = c2 = c3 = c4 = 0

Z1 = Counter(V1)

Z2 = Counter(V2)

x1, c1 = Z1.most_common(1)[0]

x2, c2 = Z2.most_common(1)[0]

if len(Z1) > 1:

    x3, c3 = Counter(V1).most_common(2)[1]

if len(Z2) > 1:

    x4, c4 = Counter(V2).most_common(2)[1]

if x1 == x2:

    a = max(c1+c4, c2+c3)

    print((N-a))

else:

    print((N - c1 - c2))
# coding: utf-8

import sys

from collections import Counter



sr = lambda: sys.stdin.readline().rstrip()

ir = lambda: int(sr())

lr = lambda: list(map(int, sr().split()))



# 奇数番目の最頻値と偶数番目の最頻値が同じ時に注意

N = ir()

V = lr()

odd = V[::2]

even = V[1::2]

cnt_odd = Counter(odd)

cnt_even = Counter(even)

cnt_odd_most = cnt_odd.most_common()

cnt_even_most = cnt_even.most_common()

if cnt_odd_most[0][0] == cnt_even_most[0][0]:

    answer = N

    if len(cnt_odd_most) > 1:

        temp = N - cnt_odd_most[1][1] - cnt_even_most[0][1]

        answer = min(answer, temp)

    if len(cnt_even_most) > 1:

        temp = N - cnt_odd_most[0][1] - cnt_even_most[1][1]

        answer = min(answer, temp)

    if answer == N:

        answer = N // 2

else:

    answer = N - cnt_odd_most[0][1] - cnt_even_most[0][1]



print(answer)

from collections import Counter

N = int(eval(input()))
V = list(map(int, input().split()))
s1 = Counter(V).most_common(2)[0]
s2 = Counter(V).most_common(2)[0]
V1 = V[0::2]
V2 = V[1::2]
c1 = c2 = c3 = c4 = 0
Z1 = Counter(V1)
Z2 = Counter(V2)
x1, c1 = Z1.most_common(1)[0]
x2, c2 = Z2.most_common(1)[0]
if len(Z1) > 1:
    x3, c3 = Counter(V1).most_common(2)[1]
if len(Z2) > 1:
    x4, c4 = Counter(V2).most_common(2)[1]
if x1 == x2:
    a = max(c1 + c4, c2 + c3)
    print((N - a))
else:
    print((N - c1 - c2))

# coding: utf-8
import sys
from collections import Counter

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
# 奇数番目の最頻値と偶数番目の最頻値が同じ時に注意
N = ir()
V = lr()
odd = V[::2]
even = V[1::2]
cnt_odd = Counter(odd)
cnt_even = Counter(even)
cnt_odd_most = cnt_odd.most_common()
cnt_even_most = cnt_even.most_common()
if cnt_odd_most[0][0] == cnt_even_most[0][0]:
    answer = N
    if len(cnt_odd_most) > 1:
        temp = N - cnt_odd_most[1][1] - cnt_even_most[0][1]
        answer = min(answer, temp)
    if len(cnt_even_most) > 1:
        temp = N - cnt_odd_most[0][1] - cnt_even_most[1][1]
        answer = min(answer, temp)
    if answer == N:
        answer = N // 2
else:
    answer = N - cnt_odd_most[0][1] - cnt_even_most[0][1]
print(answer)

+# coding: utf-8 +import sys -N = int(eval(input())) -V = list(map(int, input().split())) -s1 = Counter(V).most_common(2)[0] -s2 = Counter(V).most_common(2)[0] -V1 = V[0::2] -V2 = V[1::2] -c1 = c2 = c3 = c4 = 0 -Z1 = Counter(V1) -Z2 = Counter(V2) -x1, c1 = Z1.most_common(1)[0] -x2, c2 = Z2.most_common(1)[0] -if len(Z1) > 1: -    x3, c3 = Counter(V1).most_common(2)[1] -if len(Z2) > 1: -    x4, c4 = Counter(V2).most_common(2)[1] -if x1 == x2: -    a = max(c1 + c4, c2 + c3) -    print((N - a)) +sr = lambda: sys.stdin.readline().rstrip() +ir = lambda: int(sr()) +lr = lambda: list(map(int, sr().split())) +# 奇数番目の最頻値と偶数番目の最頻値が同じ時に注意 +N = ir() +V = lr() +odd = V[::2] +even = V[1::2] +cnt_odd = Counter(odd) +cnt_even = Counter(even) +cnt_odd_most = cnt_odd.most_common() +cnt_even_most = cnt_even.most_common() +if cnt_odd_most[0][0] == cnt_even_most[0][0]: +    answer = N +    if len(cnt_odd_most) > 1: +        temp = N - cnt_odd_most[1][1] - cnt_even_most[0][1] +        answer = min(answer, temp) +    if len(cnt_even_most) > 1: +        temp = N - cnt_odd_most[0][1] - cnt_even_most[1][1] +        answer = min(answer, temp) +    if answer == N: +        answer = N // 2 -    print((N - c1 - c2)) +    answer = N - cnt_odd_most[0][1] - cnt_even_most[0][1] +print(answer)