# coding:utf-8



import numpy as np





INF = float('inf')





def inpl(): return list(map(int, input().split()))





N = int(eval(input()))

V = inpl()



A = [0 for _ in range(10**5+1)]

for i in range(0, N, 2):

    A[V[i]] += 1



B = [0 for _ in range(10**5+1)]

for i in range(1, N, 2):

    B[V[i]] += 1



A = np.array(A)

B = np.array(B)



if A.argmax() == B.argmax():

    A.sort()

    B.sort()

    tmp = max(A[-1] + B[-2] , A[-2] + B[-1])

    ans = N - tmp

else:

    A.sort()

    B.sort()

    ans = N - A[-1] - B[-1]



print(ans)

# coding:utf-8



import sys

from collections import Counter





input = sys.stdin.readline





def inpl(): return list(map(int, input().split()))





def solve(N, V):

    v_even = [V[i] for i in range(0, N, 2)]

    v_odd = [V[i] for i in range(1, N, 2)]



    # 出現回数の多い上位2つの要素と出現回数を取得

    v_even_most = Counter(v_even).most_common()[:2]

    v_odd_most = Counter(v_odd).most_common()[:2]



    # 最頻値が被っていなければそのまま採用

    if v_even_most[0][0] != v_odd_most[0][0]:

        return N - v_even_most[0][1] - v_odd_most[0][1]

    else:

        # 数字が1種類しか登場しない場合は、0を追加

        # list index out of range対策

        if len(v_even_most) == 1 or len(v_odd_most) == 1:

            v_even_most.append((0, 0))

            v_odd_most.append((0, 0))



        # 書き換え回数が少ない方を採用

        return N - max(v_even_most[0][1] + v_odd_most[1][1],

                       v_even_most[1][1] + v_odd_most[0][1])





N = int(eval(input()))

V = inpl()

print((solve(N, V)))

# coding:utf-8
import numpy as np

INF = float("inf")


def inpl():
    return list(map(int, input().split()))


N = int(eval(input()))
V = inpl()
A = [0 for _ in range(10**5 + 1)]
for i in range(0, N, 2):
    A[V[i]] += 1
B = [0 for _ in range(10**5 + 1)]
for i in range(1, N, 2):
    B[V[i]] += 1
A = np.array(A)
B = np.array(B)
if A.argmax() == B.argmax():
    A.sort()
    B.sort()
    tmp = max(A[-1] + B[-2], A[-2] + B[-1])
    ans = N - tmp
else:
    A.sort()
    B.sort()
    ans = N - A[-1] - B[-1]
print(ans)

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

input = sys.stdin.readline


def inpl():
    return list(map(int, input().split()))


def solve(N, V):
    v_even = [V[i] for i in range(0, N, 2)]
    v_odd = [V[i] for i in range(1, N, 2)]
    # 出現回数の多い上位2つの要素と出現回数を取得
    v_even_most = Counter(v_even).most_common()[:2]
    v_odd_most = Counter(v_odd).most_common()[:2]
    # 最頻値が被っていなければそのまま採用
    if v_even_most[0][0] != v_odd_most[0][0]:
        return N - v_even_most[0][1] - v_odd_most[0][1]
    else:
        # 数字が1種類しか登場しない場合は、0を追加
        # list index out of range対策
        if len(v_even_most) == 1 or len(v_odd_most) == 1:
            v_even_most.append((0, 0))
            v_odd_most.append((0, 0))
        # 書き換え回数が少ない方を採用
        return N - max(
            v_even_most[0][1] + v_odd_most[1][1], v_even_most[1][1] + v_odd_most[0][1]
        )


N = int(eval(input()))
V = inpl()
print((solve(N, V)))

-import numpy as np +import sys +from collections import Counter -INF = float("inf") +input = sys.stdin.readline +def solve(N, V): +    v_even = [V[i] for i in range(0, N, 2)] +    v_odd = [V[i] for i in range(1, N, 2)] +    # 出現回数の多い上位2つの要素と出現回数を取得 +    v_even_most = Counter(v_even).most_common()[:2] +    v_odd_most = Counter(v_odd).most_common()[:2] +    # 最頻値が被っていなければそのまま採用 +    if v_even_most[0][0] != v_odd_most[0][0]: +        return N - v_even_most[0][1] - v_odd_most[0][1] +    else: +        # 数字が1種類しか登場しない場合は、0を追加 +        # list index out of range対策 +        if len(v_even_most) == 1 or len(v_odd_most) == 1: +            v_even_most.append((0, 0)) +            v_odd_most.append((0, 0)) +        # 書き換え回数が少ない方を採用 +        return N - max( +            v_even_most[0][1] + v_odd_most[1][1], v_even_most[1][1] + v_odd_most[0][1] +        ) + + -A = [0 for _ in range(10**5 + 1)] -for i in range(0, N, 2): -    A[V[i]] += 1 -B = [0 for _ in range(10**5 + 1)] -for i in range(1, N, 2): -    B[V[i]] += 1 -A = np.array(A) -B = np.array(B) -if A.argmax() == B.argmax(): -    A.sort() -    B.sort() -    tmp = max(A[-1] + B[-2], A[-2] + B[-1]) -    ans = N - tmp -else: -    A.sort() -    B.sort() -    ans = N - A[-1] - B[-1] -print(ans) +print((solve(N, V)))