import math,fractions

from collections import Counter

n = int(eval(input()))

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

a = [v[i] for i in range(n) if i%2]

b = [v[i] for i in range(n) if i%2==0]

cnt_a = Counter(a)

cnt_b = Counter(b)

max_a = cnt_a.most_common()[0][1]

max_b = cnt_b.most_common()[0][1]



str_a = cnt_a.most_common()[0][0]

str_b = cnt_b.most_common()[0][0]



max_2a = 0

max_2b = 0



for i in cnt_a:

    if str_a != i  and cnt_a[i] > max_2a:

        max_2a = cnt_a[i]



for i in cnt_b:

    if str_b != i  and cnt_b[i] > max_2b:

        max_2b = cnt_b[i]



if str_a != str_b:

    print((n//2 - max_a + n//2 - max_b))

else:

    tmp_a = n//2 - max_2a + n//2 - max_b

    tmp_b = n//2 - max_a + n//2 - max_2b

    print((min(tmp_a,tmp_b)))
import math,fractions

from collections import Counter

n = int(eval(input()))

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

a = Counter(v[1::2]).most_common()

b = Counter(v[0::2]).most_common()

a.append((0,0))

b.append((0,0))



if a[0][0] != b[0][0]:

    print((n//2 - a[0][1] + n//2 - b[0][1]))

else:

    tmp_x = n//2 - a[1][1] + n//2 - b[0][1]

    tmp_y = n//2 - a[0][1] + n//2 - b[1][1]

    print((min(tmp_x, tmp_y)))

import math, fractions
from collections import Counter

n = int(eval(input()))
v = [int(i) for i in input().split()]
a = [v[i] for i in range(n) if i % 2]
b = [v[i] for i in range(n) if i % 2 == 0]
cnt_a = Counter(a)
cnt_b = Counter(b)
max_a = cnt_a.most_common()[0][1]
max_b = cnt_b.most_common()[0][1]
str_a = cnt_a.most_common()[0][0]
str_b = cnt_b.most_common()[0][0]
max_2a = 0
max_2b = 0
for i in cnt_a:
    if str_a != i and cnt_a[i] > max_2a:
        max_2a = cnt_a[i]
for i in cnt_b:
    if str_b != i and cnt_b[i] > max_2b:
        max_2b = cnt_b[i]
if str_a != str_b:
    print((n // 2 - max_a + n // 2 - max_b))
else:
    tmp_a = n // 2 - max_2a + n // 2 - max_b
    tmp_b = n // 2 - max_a + n // 2 - max_2b
    print((min(tmp_a, tmp_b)))

import math, fractions
from collections import Counter

n = int(eval(input()))
v = [int(i) for i in input().split()]
a = Counter(v[1::2]).most_common()
b = Counter(v[0::2]).most_common()
a.append((0, 0))
b.append((0, 0))
if a[0][0] != b[0][0]:
    print((n // 2 - a[0][1] + n // 2 - b[0][1]))
else:
    tmp_x = n // 2 - a[1][1] + n // 2 - b[0][1]
    tmp_y = n // 2 - a[0][1] + n // 2 - b[1][1]
    print((min(tmp_x, tmp_y)))

-a = [v[i] for i in range(n) if i % 2] -b = [v[i] for i in range(n) if i % 2 == 0] -cnt_a = Counter(a) -cnt_b = Counter(b) -max_a = cnt_a.most_common()[0][1] -max_b = cnt_b.most_common()[0][1] -str_a = cnt_a.most_common()[0][0] -str_b = cnt_b.most_common()[0][0] -max_2a = 0 -max_2b = 0 -for i in cnt_a: -    if str_a != i and cnt_a[i] > max_2a: -        max_2a = cnt_a[i] -for i in cnt_b: -    if str_b != i and cnt_b[i] > max_2b: -        max_2b = cnt_b[i] -if str_a != str_b: -    print((n // 2 - max_a + n // 2 - max_b)) +a = Counter(v[1::2]).most_common() +b = Counter(v[0::2]).most_common() +a.append((0, 0)) +b.append((0, 0)) +if a[0][0] != b[0][0]: +    print((n // 2 - a[0][1] + n // 2 - b[0][1])) -    tmp_a = n // 2 - max_2a + n // 2 - max_b -    tmp_b = n // 2 - max_a + n // 2 - max_2b -    print((min(tmp_a, tmp_b))) +    tmp_x = n // 2 - a[1][1] + n // 2 - b[0][1] +    tmp_y = n // 2 - a[0][1] + n // 2 - b[1][1] +    print((min(tmp_x, tmp_y)))