from collections import Counter

N = int(eval(input()))

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

even = [[0,0]] + sorted([v,k] for k,v in list(Counter(a[1::2]).items()))

odd = [[0,0]] + sorted([v,k] for k,v in list(Counter(a[0::2]).items()))



if even[-1][1] != odd[-1][1]:

    print((N - even[-1][0] - odd[-1][0]))

else:

    print((min(N - even[-1][0] - odd[-2][0], N - even[-2][0] - odd[-1][0])))

from collections import Counter

n = int(eval(input()))

v = list(map(int, 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]

aa = Counter(a)

bb = Counter(b)

ans = 0



aas = sorted(list(aa.keys()), key=lambda key:aa[key], reverse=True)

bbs = sorted(list(bb.keys()), key=lambda key:bb[key], reverse=True)

if aas[0] != bbs[0]:

    ans += len(a) - aa[aas[0]]

    ans += len(b) - bb[bbs[0]]

else:

    if len(aa) == len(bb) and len(aa) == 1 and a[0] == b[0]:

        ans += min(len(a), len(b))

    else:

        s = len(a) - aa[aas[0]] + len(b) - bb[bbs[1]]

        t = len(a) - aa[aas[1]] + len(b) - bb[bbs[0]]

        ans = min(s,t)



print(ans)

from collections import Counter

N = int(eval(input()))
a = list(map(int, input().split()))
even = [[0, 0]] + sorted([v, k] for k, v in list(Counter(a[1::2]).items()))
odd = [[0, 0]] + sorted([v, k] for k, v in list(Counter(a[0::2]).items()))
if even[-1][1] != odd[-1][1]:
    print((N - even[-1][0] - odd[-1][0]))
else:
    print((min(N - even[-1][0] - odd[-2][0], N - even[-2][0] - odd[-1][0])))

from collections import Counter

n = int(eval(input()))
v = list(map(int, 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]
aa = Counter(a)
bb = Counter(b)
ans = 0
aas = sorted(list(aa.keys()), key=lambda key: aa[key], reverse=True)
bbs = sorted(list(bb.keys()), key=lambda key: bb[key], reverse=True)
if aas[0] != bbs[0]:
    ans += len(a) - aa[aas[0]]
    ans += len(b) - bb[bbs[0]]
else:
    if len(aa) == len(bb) and len(aa) == 1 and a[0] == b[0]:
        ans += min(len(a), len(b))
    else:
        s = len(a) - aa[aas[0]] + len(b) - bb[bbs[1]]
        t = len(a) - aa[aas[1]] + len(b) - bb[bbs[0]]
        ans = min(s, t)
print(ans)

-N = int(eval(input())) -a = list(map(int, input().split())) -even = [[0, 0]] + sorted([v, k] for k, v in list(Counter(a[1::2]).items())) -odd = [[0, 0]] + sorted([v, k] for k, v in list(Counter(a[0::2]).items())) -if even[-1][1] != odd[-1][1]: -    print((N - even[-1][0] - odd[-1][0])) +n = int(eval(input())) +v = list(map(int, 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] +aa = Counter(a) +bb = Counter(b) +ans = 0 +aas = sorted(list(aa.keys()), key=lambda key: aa[key], reverse=True) +bbs = sorted(list(bb.keys()), key=lambda key: bb[key], reverse=True) +if aas[0] != bbs[0]: +    ans += len(a) - aa[aas[0]] +    ans += len(b) - bb[bbs[0]] -    print((min(N - even[-1][0] - odd[-2][0], N - even[-2][0] - odd[-1][0]))) +    if len(aa) == len(bb) and len(aa) == 1 and a[0] == b[0]: +        ans += min(len(a), len(b)) +    else: +        s = len(a) - aa[aas[0]] + len(b) - bb[bbs[1]] +        t = len(a) - aa[aas[1]] + len(b) - bb[bbs[0]] +        ans = min(s, t) +print(ans)