import collections



n = int(eval(input()))  # even

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

e = v[0::2]

o = v[1::2]

e_cnt = collections.Counter(e)

o_cnt = collections.Counter(o)

e_most = e_cnt.most_common() + ([(0, 0)])

e_most1 = e_most[0][1]

e_most2 = e_most[1][1]

o_most = o_cnt.most_common() + ([(0, 0)])

o_most1 = o_most[0][1]

o_most2 = o_most[1][1]

if e_most[0][0] != o_most[0][0]:

    print((n - e_most1 - o_most1))

else:

    print((min(n - e_most1 - o_most2, n - e_most2 - o_most1)))
from collections import Counter





n = int(eval(input()))

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

odd_cnt = Counter(v[0::2]).most_common() + ([(0, 0)])

even_cnt = Counter(v[1::2]).most_common() + ([(0, 0)])

if odd_cnt[0][0] != even_cnt[0][0]:

    ans = n - odd_cnt[0][1] - even_cnt[0][1]

else:

    ans = min(n - odd_cnt[1][1] - even_cnt[0][1], n - odd_cnt[0][1] - even_cnt[1][1])

print(ans)

import collections

n = int(eval(input()))  # even
v = list(map(int, input().split()))
e = v[0::2]
o = v[1::2]
e_cnt = collections.Counter(e)
o_cnt = collections.Counter(o)
e_most = e_cnt.most_common() + ([(0, 0)])
e_most1 = e_most[0][1]
e_most2 = e_most[1][1]
o_most = o_cnt.most_common() + ([(0, 0)])
o_most1 = o_most[0][1]
o_most2 = o_most[1][1]
if e_most[0][0] != o_most[0][0]:
    print((n - e_most1 - o_most1))
else:
    print((min(n - e_most1 - o_most2, n - e_most2 - o_most1)))

from collections import Counter

n = int(eval(input()))
v = list(map(int, input().split()))
odd_cnt = Counter(v[0::2]).most_common() + ([(0, 0)])
even_cnt = Counter(v[1::2]).most_common() + ([(0, 0)])
if odd_cnt[0][0] != even_cnt[0][0]:
    ans = n - odd_cnt[0][1] - even_cnt[0][1]
else:
    ans = min(n - odd_cnt[1][1] - even_cnt[0][1], n - odd_cnt[0][1] - even_cnt[1][1])
print(ans)

-import collections +from collections import Counter -n = int(eval(input()))  # even +n = int(eval(input())) -e = v[0::2] -o = v[1::2] -e_cnt = collections.Counter(e) -o_cnt = collections.Counter(o) -e_most = e_cnt.most_common() + ([(0, 0)]) -e_most1 = e_most[0][1] -e_most2 = e_most[1][1] -o_most = o_cnt.most_common() + ([(0, 0)]) -o_most1 = o_most[0][1] -o_most2 = o_most[1][1] -if e_most[0][0] != o_most[0][0]: -    print((n - e_most1 - o_most1)) +odd_cnt = Counter(v[0::2]).most_common() + ([(0, 0)]) +even_cnt = Counter(v[1::2]).most_common() + ([(0, 0)]) +if odd_cnt[0][0] != even_cnt[0][0]: +    ans = n - odd_cnt[0][1] - even_cnt[0][1] -    print((min(n - e_most1 - o_most2, n - e_most2 - o_most1))) +    ans = min(n - odd_cnt[1][1] - even_cnt[0][1], n - odd_cnt[0][1] - even_cnt[1][1]) +print(ans)