#!/usr/bin/env python3



n = int(eval(input()))

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

cnt_odd = [0]*(10**5+1)# a[2k]での個数

cnt_even = [0]*(10**5+1)

for i in range(n):

    if i  %2: cnt_odd[a[i]] += 1

    else: cnt_even[a[i]] += 1

odd,idx_odd=list(zip(*sorted(zip(cnt_odd,list(range(10**5+1))))))

even,idx_even=list(zip(*sorted(zip(cnt_even,list(range(10**5+1))))))

#print(odd[-1],even[-2],odd[-2],even[-1])

if idx_even[-1]!=idx_odd[-1]:

    print((n - odd[-1] - even[-1]))

else:

    print((n - max(odd[-1]+even[-2],odd[-2]+even[-1])))

#ちゃんとテストケース書かないと落ちる

n = int(eval(input()))

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

freq_odd = [0] * (10 ** 5 + 1)

freq_even = [0] * (10 ** 5 + 1)

for i in range(n // 2):

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

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

# print(freq_odd[:10], freq_even[:10])

freq_even, id_even = list(zip(*sorted(zip(freq_even, list(range(10 ** 5 + 1))))))

freq_odd, id_odd = list(zip(*sorted(zip(freq_odd, list(range(10 ** 5 + 1))))))

# print(freq_odd[-2:], freq_even[-2:])

# print(id_even[-1], id_odd[-1])

if id_even[-1] != id_odd[-1]:

    print((n - freq_even[-1] - freq_odd[-1]))

else:

    print((min(n - freq_even[-2] - freq_odd[-1], n - freq_even[-1] - freq_odd[-2])))

#!/usr/bin/env python3
n = int(eval(input()))
a = list(map(int, input().split()))
cnt_odd = [0] * (10**5 + 1)  # a[2k]での個数
cnt_even = [0] * (10**5 + 1)
for i in range(n):
    if i % 2:
        cnt_odd[a[i]] += 1
    else:
        cnt_even[a[i]] += 1
odd, idx_odd = list(zip(*sorted(zip(cnt_odd, list(range(10**5 + 1))))))
even, idx_even = list(zip(*sorted(zip(cnt_even, list(range(10**5 + 1))))))
# print(odd[-1],even[-2],odd[-2],even[-1])
if idx_even[-1] != idx_odd[-1]:
    print((n - odd[-1] - even[-1]))
else:
    print((n - max(odd[-1] + even[-2], odd[-2] + even[-1])))
# ちゃんとテストケース書かないと落ちる

n = int(eval(input()))
v = list(map(int, input().split()))
freq_odd = [0] * (10**5 + 1)
freq_even = [0] * (10**5 + 1)
for i in range(n // 2):
    freq_odd[v[2 * i]] += 1
    freq_even[v[2 * i + 1]] += 1
# print(freq_odd[:10], freq_even[:10])
freq_even, id_even = list(zip(*sorted(zip(freq_even, list(range(10**5 + 1))))))
freq_odd, id_odd = list(zip(*sorted(zip(freq_odd, list(range(10**5 + 1))))))
# print(freq_odd[-2:], freq_even[-2:])
# print(id_even[-1], id_odd[-1])
if id_even[-1] != id_odd[-1]:
    print((n - freq_even[-1] - freq_odd[-1]))
else:
    print((min(n - freq_even[-2] - freq_odd[-1], n - freq_even[-1] - freq_odd[-2])))

-#!/usr/bin/env python3 -a = list(map(int, input().split())) -cnt_odd = [0] * (10**5 + 1)  # a[2k]での個数 -cnt_even = [0] * (10**5 + 1) -for i in range(n): -    if i % 2: -        cnt_odd[a[i]] += 1 -    else: -        cnt_even[a[i]] += 1 -odd, idx_odd = list(zip(*sorted(zip(cnt_odd, list(range(10**5 + 1)))))) -even, idx_even = list(zip(*sorted(zip(cnt_even, list(range(10**5 + 1)))))) -# print(odd[-1],even[-2],odd[-2],even[-1]) -if idx_even[-1] != idx_odd[-1]: -    print((n - odd[-1] - even[-1])) +v = list(map(int, input().split())) +freq_odd = [0] * (10**5 + 1) +freq_even = [0] * (10**5 + 1) +for i in range(n // 2): +    freq_odd[v[2 * i]] += 1 +    freq_even[v[2 * i + 1]] += 1 +# print(freq_odd[:10], freq_even[:10]) +freq_even, id_even = list(zip(*sorted(zip(freq_even, list(range(10**5 + 1)))))) +freq_odd, id_odd = list(zip(*sorted(zip(freq_odd, list(range(10**5 + 1)))))) +# print(freq_odd[-2:], freq_even[-2:]) +# print(id_even[-1], id_odd[-1]) +if id_even[-1] != id_odd[-1]: +    print((n - freq_even[-1] - freq_odd[-1])) -    print((n - max(odd[-1] + even[-2], odd[-2] + even[-1]))) -# ちゃんとテストケース書かないと落ちる +    print((min(n - freq_even[-2] - freq_odd[-1], n - freq_even[-1] - freq_odd[-2])))