from collections import Counter

size = int(input())

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

even, odd = Counter(ary[::2]), Counter(ary[1::2])

even[0], odd[0] = 0, 0

(e, em), (_, es) = even.most_common(2)

(o, om), (_, os) = odd.most_common(2)

print(size - max(em + os, es + om)) if e == o else print(size - em - om)

def solve(size=int(eval(input())), ary=list(map(int, input().split())), max_range=100001):

    even = [0 for _ in range(max_range)]

    odd = [0 for _ in range(max_range)]



    (em, ei), (om, oi) = (0, 0), (0, 0)



    for i in range(size):

        if i % 2 == 0:

            even[ary[i]] += 1

            if even[ary[i]] > em:

                em, ei = even[ary[i]], ary[i]

        else:

            odd[ary[i]] += 1

            if odd[ary[i]] > om:

                om, oi = odd[ary[i]], ary[i]



    if ei == oi:

        even[ei], odd[oi] = 0, 0

        return size - max(max(even) + om, max(odd) + em)

    else:

        return size - (em + om)



print((solve()))
from collections import Counter

size = int(input())
ary = list(map(int, input().split()))
even, odd = Counter(ary[::2]), Counter(ary[1::2])
even[0], odd[0] = 0, 0
(e, em), (_, es) = even.most_common(2)
(o, om), (_, os) = odd.most_common(2)
print(size - max(em + os, es + om)) if e == o else print(size - em - om)

def solve(
    size=int(eval(input())), ary=list(map(int, input().split())), max_range=100001
):
    even = [0 for _ in range(max_range)]
    odd = [0 for _ in range(max_range)]
    (em, ei), (om, oi) = (0, 0), (0, 0)
    for i in range(size):
        if i % 2 == 0:
            even[ary[i]] += 1
            if even[ary[i]] > em:
                em, ei = even[ary[i]], ary[i]
        else:
            odd[ary[i]] += 1
            if odd[ary[i]] > om:
                om, oi = odd[ary[i]], ary[i]
    if ei == oi:
        even[ei], odd[oi] = 0, 0
        return size - max(max(even) + om, max(odd) + em)
    else:
        return size - (em + om)


print((solve()))

-from collections import Counter +def solve( +    size=int(eval(input())), ary=list(map(int, input().split())), max_range=100001 +): +    even = [0 for _ in range(max_range)] +    odd = [0 for _ in range(max_range)] +    (em, ei), (om, oi) = (0, 0), (0, 0) +    for i in range(size): +        if i % 2 == 0: +            even[ary[i]] += 1 +            if even[ary[i]] > em: +                em, ei = even[ary[i]], ary[i] +        else: +            odd[ary[i]] += 1 +            if odd[ary[i]] > om: +                om, oi = odd[ary[i]], ary[i] +    if ei == oi: +        even[ei], odd[oi] = 0, 0 +        return size - max(max(even) + om, max(odd) + em) +    else: +        return size - (em + om) -size = int(input()) -ary = list(map(int, input().split())) -even, odd = Counter(ary[::2]), Counter(ary[1::2]) -even[0], odd[0] = 0, 0 -(e, em), (_, es) = even.most_common(2) -(o, om), (_, os) = odd.most_common(2) -print(size - max(em + os, es + om)) if e == o else print(size - em - om) + +print((solve()))