from collections import defaultdict



N = int(eval(input()))

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



if len(set(L)) == 1:

    print((N//2))

    exit()

if N == 2:

    print((0))

    exit()





d_even = defaultdict(int)

d_odd = defaultdict(int)



for i in range(N):

    v = L[i]

    if i % 2 == 0:

        d_even[v] += 1

    else:

        d_odd[v] += 1



l_even = sorted(list(d_even.items()), key=lambda x: -x[1])

l_odd = sorted(list(d_odd.items()), key=lambda x: -x[1])



if l_even[0][0] != l_odd[0][0]:

    print((N - l_odd[0][1] - l_even[0][1]))

    exit()



ans = N

ans = min(ans, N - l_odd[0][1] - l_even[1][1])

ans = min(ans, N - l_odd[1][1] - l_even[0][1])

print(ans)

from collections import Counter



N = int(eval(input()))

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

odd = [v for i, v in enumerate(L) if i % 2 == 0]

even = [v for i, v in enumerate(L) if i % 2 == 1]



if len(set(L)) == 1:

    print((N//2))

    exit()

if N == 2:

    print((0))

    exit()





c_odd = sorted(list(dict(Counter(odd)).items()), key=lambda x: -x[1])

c_even = sorted(list(dict(Counter(even)).items()), key=lambda x: -x[1])



odd_1 = c_odd[0]

even_1 = c_even[0]



if odd_1[0] != even_1[0]:

    print((N - odd_1[1] - even_1[1]))

    exit()



even_2 = c_even[1]

odd_2 = c_odd[1]



ans = N

ans = min(ans, N - odd_1[1] - even_2[1])

ans = min(ans, N - odd_2[1] - even_1[1])

print(ans)

from collections import defaultdict

N = int(eval(input()))
L = list(map(int, input().split()))
if len(set(L)) == 1:
    print((N // 2))
    exit()
if N == 2:
    print((0))
    exit()
d_even = defaultdict(int)
d_odd = defaultdict(int)
for i in range(N):
    v = L[i]
    if i % 2 == 0:
        d_even[v] += 1
    else:
        d_odd[v] += 1
l_even = sorted(list(d_even.items()), key=lambda x: -x[1])
l_odd = sorted(list(d_odd.items()), key=lambda x: -x[1])
if l_even[0][0] != l_odd[0][0]:
    print((N - l_odd[0][1] - l_even[0][1]))
    exit()
ans = N
ans = min(ans, N - l_odd[0][1] - l_even[1][1])
ans = min(ans, N - l_odd[1][1] - l_even[0][1])
print(ans)

from collections import Counter

N = int(eval(input()))
L = list(map(int, input().split()))
odd = [v for i, v in enumerate(L) if i % 2 == 0]
even = [v for i, v in enumerate(L) if i % 2 == 1]
if len(set(L)) == 1:
    print((N // 2))
    exit()
if N == 2:
    print((0))
    exit()
c_odd = sorted(list(dict(Counter(odd)).items()), key=lambda x: -x[1])
c_even = sorted(list(dict(Counter(even)).items()), key=lambda x: -x[1])
odd_1 = c_odd[0]
even_1 = c_even[0]
if odd_1[0] != even_1[0]:
    print((N - odd_1[1] - even_1[1]))
    exit()
even_2 = c_even[1]
odd_2 = c_odd[1]
ans = N
ans = min(ans, N - odd_1[1] - even_2[1])
ans = min(ans, N - odd_2[1] - even_1[1])
print(ans)

-from collections import defaultdict +from collections import Counter +odd = [v for i, v in enumerate(L) if i % 2 == 0] +even = [v for i, v in enumerate(L) if i % 2 == 1] -d_even = defaultdict(int) -d_odd = defaultdict(int) -for i in range(N): -    v = L[i] -    if i % 2 == 0: -        d_even[v] += 1 -    else: -        d_odd[v] += 1 -l_even = sorted(list(d_even.items()), key=lambda x: -x[1]) -l_odd = sorted(list(d_odd.items()), key=lambda x: -x[1]) -if l_even[0][0] != l_odd[0][0]: -    print((N - l_odd[0][1] - l_even[0][1])) +c_odd = sorted(list(dict(Counter(odd)).items()), key=lambda x: -x[1]) +c_even = sorted(list(dict(Counter(even)).items()), key=lambda x: -x[1]) +odd_1 = c_odd[0] +even_1 = c_even[0] +if odd_1[0] != even_1[0]: +    print((N - odd_1[1] - even_1[1])) +even_2 = c_even[1] +odd_2 = c_odd[1] -ans = min(ans, N - l_odd[0][1] - l_even[1][1]) -ans = min(ans, N - l_odd[1][1] - l_even[0][1]) +ans = min(ans, N - odd_1[1] - even_2[1]) +ans = min(ans, N - odd_2[1] - even_1[1])