from collections import Counter

n = int(eval(input()))

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

v1 = []

v2 = []

for i in range(n):

    if i % 2 == 0:

        v1.append(v[i])

    else:

        v2.append(v[i])

v_count = Counter(v)

v1_count = Counter(v1)

v2_count = Counter(v2)

# print("v1_count", v1_count)

# print("v2_count", v2_count)

v1_comm = v1_count.most_common(1)

v2_comm = v2_count.most_common(1)

sols = []

# print("v1_comm", v1_comm)

# print("v2_comm", v2_comm)

if len(v_count) == 1:

    print((n//2))

else:

    key1 = v1_comm[0][1]

    # print("v1_comm[0][0]", v1_comm[0][0])

    # print("v2_comm[0][0]", v2_comm[0][0])

    if v1_comm[0][0] == v2_comm[0][0]:

        # print("hoge")

        v2_comm = v2_count.most_common(2)

        key2 = v2_comm[1][1]

    else:

        key2 = v2_comm[0][1]

    sols.append(n-key1-key2)

    key1 = v2_comm[0][1]

    if v1_comm[0][0] == v2_comm[0][0]:

        v1_comm = v1_count.most_common(2)

        key2 = v1_comm[1][1]

    else:

        key2 = v1_comm[0][1]

    sols.append(n-key1-key2)

    print((min(sols)))

from collections import Counter



n = int(eval(input()))

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



# 最終的な2値をx, yとしたとき書き換える要素が最小の場合は、

# xは、書き換えが最も少ない数。つまり、もともと最も多い数

# yも同様。

# ただ、xとyがかぶる場合があるので、それに対処。

if len(Counter(v)) > 1:

    v1 = v[0:n+1:2]

    # print(v)

    # print(v1)

    v2 = v[1:n+2:2]

    # print(v2)

    v1_count = Counter(v1)

    v2_count = Counter(v2)



    v1_1st_common = v1_count.most_common(1)

    v2_1st_common = v2_count.most_common(1)

    sols = []

    # print(v1_1st_common[0][1], v2_1st_common[0][1])

    # v1を基準として多い方を考える場合。

    n1 = v1_1st_common[0][1]

    # v1の1位とv2の1位がかぶる場合

    if v1_1st_common[0][0] == v2_1st_common[0][0]:

        if len(v2_count) >= 2:

            v2_2nd_common = v2_count.most_common(2)

            n2 = v2_2nd_common[1][1]

        else:

            print((n//2))

    else:

        n2 = v2_1st_common[0][1]

    sols.append(n-n1-n2)



    # v2を基準として多い方を考える場合。

    n2 = v2_1st_common[0][1]

    # v1の1位とv2の1位がかぶる場合

    if v1_1st_common[0][0] == v2_1st_common[0][0]:

         if len(v1_count) >= 2:

            v1_2nd_common = v1_count.most_common(2)

            n1 = v1_2nd_common[1][1]

         else:

            print((n//2))

    else:

        n1 = v1_1st_common[0][1]

    sols.append(n-n1-n2)

    print((min(sols)))

else:

    print((n//2))
from collections import Counter

n = int(eval(input()))
v = [int(_) for _ in input().split()]
v1 = []
v2 = []
for i in range(n):
    if i % 2 == 0:
        v1.append(v[i])
    else:
        v2.append(v[i])
v_count = Counter(v)
v1_count = Counter(v1)
v2_count = Counter(v2)
# print("v1_count", v1_count)
# print("v2_count", v2_count)
v1_comm = v1_count.most_common(1)
v2_comm = v2_count.most_common(1)
sols = []
# print("v1_comm", v1_comm)
# print("v2_comm", v2_comm)
if len(v_count) == 1:
    print((n // 2))
else:
    key1 = v1_comm[0][1]
    # print("v1_comm[0][0]", v1_comm[0][0])
    # print("v2_comm[0][0]", v2_comm[0][0])
    if v1_comm[0][0] == v2_comm[0][0]:
        # print("hoge")
        v2_comm = v2_count.most_common(2)
        key2 = v2_comm[1][1]
    else:
        key2 = v2_comm[0][1]
    sols.append(n - key1 - key2)
    key1 = v2_comm[0][1]
    if v1_comm[0][0] == v2_comm[0][0]:
        v1_comm = v1_count.most_common(2)
        key2 = v1_comm[1][1]
    else:
        key2 = v1_comm[0][1]
    sols.append(n - key1 - key2)
    print((min(sols)))

from collections import Counter

n = int(eval(input()))
v = [int(_) for _ in input().split()]
# 最終的な2値をx, yとしたとき書き換える要素が最小の場合は、
# xは、書き換えが最も少ない数。つまり、もともと最も多い数
# yも同様。
# ただ、xとyがかぶる場合があるので、それに対処。
if len(Counter(v)) > 1:
    v1 = v[0 : n + 1 : 2]
    # print(v)
    # print(v1)
    v2 = v[1 : n + 2 : 2]
    # print(v2)
    v1_count = Counter(v1)
    v2_count = Counter(v2)
    v1_1st_common = v1_count.most_common(1)
    v2_1st_common = v2_count.most_common(1)
    sols = []
    # print(v1_1st_common[0][1], v2_1st_common[0][1])
    # v1を基準として多い方を考える場合。
    n1 = v1_1st_common[0][1]
    # v1の1位とv2の1位がかぶる場合
    if v1_1st_common[0][0] == v2_1st_common[0][0]:
        if len(v2_count) >= 2:
            v2_2nd_common = v2_count.most_common(2)
            n2 = v2_2nd_common[1][1]
        else:
            print((n // 2))
    else:
        n2 = v2_1st_common[0][1]
    sols.append(n - n1 - n2)
    # v2を基準として多い方を考える場合。
    n2 = v2_1st_common[0][1]
    # v1の1位とv2の1位がかぶる場合
    if v1_1st_common[0][0] == v2_1st_common[0][0]:
        if len(v1_count) >= 2:
            v1_2nd_common = v1_count.most_common(2)
            n1 = v1_2nd_common[1][1]
        else:
            print((n // 2))
    else:
        n1 = v1_1st_common[0][1]
    sols.append(n - n1 - n2)
    print((min(sols)))
else:
    print((n // 2))

-v1 = [] -v2 = [] -for i in range(n): -    if i % 2 == 0: -        v1.append(v[i]) +# 最終的な2値をx, yとしたとき書き換える要素が最小の場合は、 +# xは、書き換えが最も少ない数。つまり、もともと最も多い数 +# yも同様。 +# ただ、xとyがかぶる場合があるので、それに対処。 +if len(Counter(v)) > 1: +    v1 = v[0 : n + 1 : 2] +    # print(v) +    # print(v1) +    v2 = v[1 : n + 2 : 2] +    # print(v2) +    v1_count = Counter(v1) +    v2_count = Counter(v2) +    v1_1st_common = v1_count.most_common(1) +    v2_1st_common = v2_count.most_common(1) +    sols = [] +    # print(v1_1st_common[0][1], v2_1st_common[0][1]) +    # v1を基準として多い方を考える場合。 +    n1 = v1_1st_common[0][1] +    # v1の1位とv2の1位がかぶる場合 +    if v1_1st_common[0][0] == v2_1st_common[0][0]: +        if len(v2_count) >= 2: +            v2_2nd_common = v2_count.most_common(2) +            n2 = v2_2nd_common[1][1] +        else: +            print((n // 2)) -        v2.append(v[i]) -v_count = Counter(v) -v1_count = Counter(v1) -v2_count = Counter(v2) -# print("v1_count", v1_count) -# print("v2_count", v2_count) -v1_comm = v1_count.most_common(1) -v2_comm = v2_count.most_common(1) -sols = [] -# print("v1_comm", v1_comm) -# print("v2_comm", v2_comm) -if len(v_count) == 1: +        n2 = v2_1st_common[0][1] +    sols.append(n - n1 - n2) +    # v2を基準として多い方を考える場合。 +    n2 = v2_1st_common[0][1] +    # v1の1位とv2の1位がかぶる場合 +    if v1_1st_common[0][0] == v2_1st_common[0][0]: +        if len(v1_count) >= 2: +            v1_2nd_common = v1_count.most_common(2) +            n1 = v1_2nd_common[1][1] +        else: +            print((n // 2)) +    else: +        n1 = v1_1st_common[0][1] +    sols.append(n - n1 - n2) +    print((min(sols))) +else: -else: -    key1 = v1_comm[0][1] -    # print("v1_comm[0][0]", v1_comm[0][0]) -    # print("v2_comm[0][0]", v2_comm[0][0]) -    if v1_comm[0][0] == v2_comm[0][0]: -        # print("hoge") -        v2_comm = v2_count.most_common(2) -        key2 = v2_comm[1][1] -    else: -        key2 = v2_comm[0][1] -    sols.append(n - key1 - key2) -    key1 = v2_comm[0][1] -    if v1_comm[0][0] == v2_comm[0][0]: -        v1_comm = v1_count.most_common(2) -        key2 = v1_comm[1][1] -    else: -        key2 = v1_comm[0][1] -    sols.append(n - key1 - key2) -    print((min(sols)))