from collections import defaultdict

n = int(eval(input()))

v = [int(x) for x in input().split()]



even_ocr = defaultdict(int) # v[0], v[2], ..., で各数が何回現れるか

odd_ocr = defaultdict(int)  # v[1], v[3], ..., で各数が何回現れるか



for i in range(n // 2):

    even_ocr[v[2 * i]] += 1

    odd_ocr[v[2 * i + 1]] += 1



even_max_num = 0;  even_max_ocr = 0;

odd_max_num = 0;  odd_max_ocr = 0;

for (num, ocr) in list(even_ocr.items()):

    if ocr > even_max_ocr:

        even_max_ocr = ocr

        even_max_num = num



for (num, ocr) in list(odd_ocr.items()):

    if ocr > odd_max_ocr:

        odd_max_ocr = ocr

        odd_max_num = num



if even_max_num != odd_max_num:

    ans = n - even_max_ocr - odd_max_ocr

else:

# 偶数番目に一番多く現れる数と奇数番目に一番多く現れる数が同じ

    even_next_num = 0;  even_next_ocr = 0;

    odd_next_num = 0;  odd_next_ocr = 0;

    for (num, ocr) in list(even_ocr.items()):

        if num != even_max_num and ocr > even_next_ocr:

            even_next_ocr = ocr

            even_next_num = num



    for (num, ocr) in list(odd_ocr.items()):

        if num != odd_max_num and ocr > odd_next_ocr:

            odd_next_ocr = ocr

            odd_next_num = num



    if even_next_ocr + odd_max_ocr > even_max_ocr + odd_next_ocr:

        # 偶数番目は二番目に多い数、奇数番目は一番多い数に揃える

        ans = n - even_next_ocr - odd_max_ocr

    else:

        ans = n - even_max_ocr - odd_next_ocr



print(ans)
from collections import defaultdict, Counter

n = int(eval(input()))

v = [int(x) for x in input().split()]



cnt_even = Counter(v[0::2])

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



# [(要素, 出現回数), (要素, 出現回数), ....]

common_even = cnt_even.most_common()

common_odd = cnt_odd.most_common()

if len(common_even) == 1:   # 1種類の数しかない

    common_even.append((0, 0))

if len(common_odd) == 1:

    common_odd.append((0, 0))



# 偶数番目に一番多く現れる数と奇数番目に一番多く現れる数が異なる

if common_even[0][0] != common_odd[0][0]:

    ans = n - common_even[0][1] - common_odd[0][1]

else:

    ans = min(n - common_even[1][1] - common_odd[0][1], \

              n - common_even[0][1] - common_odd[1][1])



print(ans)
from collections import defaultdict

n = int(eval(input()))
v = [int(x) for x in input().split()]
even_ocr = defaultdict(int)  # v[0], v[2], ..., で各数が何回現れるか
odd_ocr = defaultdict(int)  # v[1], v[3], ..., で各数が何回現れるか
for i in range(n // 2):
    even_ocr[v[2 * i]] += 1
    odd_ocr[v[2 * i + 1]] += 1
even_max_num = 0
even_max_ocr = 0
odd_max_num = 0
odd_max_ocr = 0
for (num, ocr) in list(even_ocr.items()):
    if ocr > even_max_ocr:
        even_max_ocr = ocr
        even_max_num = num
for (num, ocr) in list(odd_ocr.items()):
    if ocr > odd_max_ocr:
        odd_max_ocr = ocr
        odd_max_num = num
if even_max_num != odd_max_num:
    ans = n - even_max_ocr - odd_max_ocr
else:
    # 偶数番目に一番多く現れる数と奇数番目に一番多く現れる数が同じ
    even_next_num = 0
    even_next_ocr = 0
    odd_next_num = 0
    odd_next_ocr = 0
    for (num, ocr) in list(even_ocr.items()):
        if num != even_max_num and ocr > even_next_ocr:
            even_next_ocr = ocr
            even_next_num = num
    for (num, ocr) in list(odd_ocr.items()):
        if num != odd_max_num and ocr > odd_next_ocr:
            odd_next_ocr = ocr
            odd_next_num = num
    if even_next_ocr + odd_max_ocr > even_max_ocr + odd_next_ocr:
        # 偶数番目は二番目に多い数、奇数番目は一番多い数に揃える
        ans = n - even_next_ocr - odd_max_ocr
    else:
        ans = n - even_max_ocr - odd_next_ocr
print(ans)

from collections import defaultdict, Counter

n = int(eval(input()))
v = [int(x) for x in input().split()]
cnt_even = Counter(v[0::2])
cnt_odd = Counter(v[1::2])
# [(要素, 出現回数), (要素, 出現回数), ....]
common_even = cnt_even.most_common()
common_odd = cnt_odd.most_common()
if len(common_even) == 1:  # 1種類の数しかない
    common_even.append((0, 0))
if len(common_odd) == 1:
    common_odd.append((0, 0))
# 偶数番目に一番多く現れる数と奇数番目に一番多く現れる数が異なる
if common_even[0][0] != common_odd[0][0]:
    ans = n - common_even[0][1] - common_odd[0][1]
else:
    ans = min(
        n - common_even[1][1] - common_odd[0][1],
        n - common_even[0][1] - common_odd[1][1],
    )
print(ans)

-from collections import defaultdict +from collections import defaultdict, Counter -even_ocr = defaultdict(int)  # v[0], v[2], ..., で各数が何回現れるか -odd_ocr = defaultdict(int)  # v[1], v[3], ..., で各数が何回現れるか -for i in range(n // 2): -    even_ocr[v[2 * i]] += 1 -    odd_ocr[v[2 * i + 1]] += 1 -even_max_num = 0 -even_max_ocr = 0 -odd_max_num = 0 -odd_max_ocr = 0 -for (num, ocr) in list(even_ocr.items()): -    if ocr > even_max_ocr: -        even_max_ocr = ocr -        even_max_num = num -for (num, ocr) in list(odd_ocr.items()): -    if ocr > odd_max_ocr: -        odd_max_ocr = ocr -        odd_max_num = num -if even_max_num != odd_max_num: -    ans = n - even_max_ocr - odd_max_ocr +cnt_even = Counter(v[0::2]) +cnt_odd = Counter(v[1::2]) +# [(要素, 出現回数), (要素, 出現回数), ....] +common_even = cnt_even.most_common() +common_odd = cnt_odd.most_common() +if len(common_even) == 1:  # 1種類の数しかない +    common_even.append((0, 0)) +if len(common_odd) == 1: +    common_odd.append((0, 0)) +# 偶数番目に一番多く現れる数と奇数番目に一番多く現れる数が異なる +if common_even[0][0] != common_odd[0][0]: +    ans = n - common_even[0][1] - common_odd[0][1] -    # 偶数番目に一番多く現れる数と奇数番目に一番多く現れる数が同じ -    even_next_num = 0 -    even_next_ocr = 0 -    odd_next_num = 0 -    odd_next_ocr = 0 -    for (num, ocr) in list(even_ocr.items()): -        if num != even_max_num and ocr > even_next_ocr: -            even_next_ocr = ocr -            even_next_num = num -    for (num, ocr) in list(odd_ocr.items()): -        if num != odd_max_num and ocr > odd_next_ocr: -            odd_next_ocr = ocr -            odd_next_num = num -    if even_next_ocr + odd_max_ocr > even_max_ocr + odd_next_ocr: -        # 偶数番目は二番目に多い数、奇数番目は一番多い数に揃える -        ans = n - even_next_ocr - odd_max_ocr -    else: -        ans = n - even_max_ocr - odd_next_ocr +    ans = min( +        n - common_even[1][1] - common_odd[0][1], +        n - common_even[0][1] - common_odd[1][1], +    )