n = int(eval(input()))

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



cnt_arr = [dict() for _ in range(2)]



for i in range(n):

    cnt_arr[i % 2][v[i]] = cnt_arr[i % 2].get(v[i], 0) + 1



v_even = sorted(list(cnt_arr[0].items()), key=lambda x: x[1], reverse=True)[:2]  # [value, 出現数] * 2（上位2）

v_odd = sorted(list(cnt_arr[1].items()), key=lambda x: x[1], reverse=True)[:2]  # [value, 出現数] * 2（上位2）



keep = 0

flg = False

for even in v_even:  # [0]: 数値, [1]: 出現数

    for odd in v_odd:  # [0]: 数値, [1]: 出現数

        if even[0] != odd[0]:

            flg = True

            keep = max(keep, even[1] + odd[1])



ans = n - keep if flg else n // 2

print(ans)
from collections import Counter



n = int(eval(input()))

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



evens = Counter(v[::2])

odds = Counter(v[1::2])



evens[0] = 0  # 一種類の数値しか含まれないときの対策

odds[0] = 0



keep = 0

for even in evens.most_common(2):

    for odd in odds.most_common(2):

        if even[0] != odd[0]:

            keep = max(keep, even[1] + odd[1])



print((n - keep))
n = int(eval(input()))
v = list(map(int, input().split()))
cnt_arr = [dict() for _ in range(2)]
for i in range(n):
    cnt_arr[i % 2][v[i]] = cnt_arr[i % 2].get(v[i], 0) + 1
v_even = sorted(list(cnt_arr[0].items()), key=lambda x: x[1], reverse=True)[
    :2
]  # [value, 出現数] * 2（上位2）
v_odd = sorted(list(cnt_arr[1].items()), key=lambda x: x[1], reverse=True)[
    :2
]  # [value, 出現数] * 2（上位2）
keep = 0
flg = False
for even in v_even:  # [0]: 数値, [1]: 出現数
    for odd in v_odd:  # [0]: 数値, [1]: 出現数
        if even[0] != odd[0]:
            flg = True
            keep = max(keep, even[1] + odd[1])
ans = n - keep if flg else n // 2
print(ans)

from collections import Counter

n = int(eval(input()))
v = list(map(int, input().split()))
evens = Counter(v[::2])
odds = Counter(v[1::2])
evens[0] = 0  # 一種類の数値しか含まれないときの対策
odds[0] = 0
keep = 0
for even in evens.most_common(2):
    for odd in odds.most_common(2):
        if even[0] != odd[0]:
            keep = max(keep, even[1] + odd[1])
print((n - keep))

+from collections import Counter + -cnt_arr = [dict() for _ in range(2)] -for i in range(n): -    cnt_arr[i % 2][v[i]] = cnt_arr[i % 2].get(v[i], 0) + 1 -v_even = sorted(list(cnt_arr[0].items()), key=lambda x: x[1], reverse=True)[ -    :2 -]  # [value, 出現数] * 2（上位2） -v_odd = sorted(list(cnt_arr[1].items()), key=lambda x: x[1], reverse=True)[ -    :2 -]  # [value, 出現数] * 2（上位2） +evens = Counter(v[::2]) +odds = Counter(v[1::2]) +evens[0] = 0  # 一種類の数値しか含まれないときの対策 +odds[0] = 0 -flg = False -for even in v_even:  # [0]: 数値, [1]: 出現数 -    for odd in v_odd:  # [0]: 数値, [1]: 出現数 +for even in evens.most_common(2): +    for odd in odds.most_common(2): -            flg = True -ans = n - keep if flg else n // 2 -print(ans) +print((n - keep))