from collections import Counter

N = int(eval(input()))

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

c1 = Counter(A[::2])

c2 = Counter(A[1::2])

c1[0] = 0

c2[0] = 0

c1m = max(list(c1.items()), key=lambda x:x[1])

c2m = max(list(c2.items()), key=lambda x:x[1])

c1c2 = max(c for k,c in list(c2.items()) if c1m[0]!=k)

c2c1 = max(c for k,c in list(c1.items()) if c2m[0]!=k)

print((min(N - c1m[1] - c1c2, N - c2m[1] - c2c1)))
from collections import Counter

n = int(eval(input()))

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

c1 = Counter(V[::2])

c2 = Counter(V[1::2])

c1[0] = 0

c2[0] = 0

(x, cx), (_, cxx) = c1.most_common(2)

(y, cy), (_, cyy) = c2.most_common(2)

if x == y:

    print((n - max(cx + cyy, cy + cxx)))

else:

    print((n - cx - cy))
from collections import Counter

N = int(eval(input()))
A = list(map(int, input().split()))
c1 = Counter(A[::2])
c2 = Counter(A[1::2])
c1[0] = 0
c2[0] = 0
c1m = max(list(c1.items()), key=lambda x: x[1])
c2m = max(list(c2.items()), key=lambda x: x[1])
c1c2 = max(c for k, c in list(c2.items()) if c1m[0] != k)
c2c1 = max(c for k, c in list(c1.items()) if c2m[0] != k)
print((min(N - c1m[1] - c1c2, N - c2m[1] - c2c1)))

from collections import Counter

n = int(eval(input()))
V = list(map(int, input().split()))
c1 = Counter(V[::2])
c2 = Counter(V[1::2])
c1[0] = 0
c2[0] = 0
(x, cx), (_, cxx) = c1.most_common(2)
(y, cy), (_, cyy) = c2.most_common(2)
if x == y:
    print((n - max(cx + cyy, cy + cxx)))
else:
    print((n - cx - cy))

-N = int(eval(input())) -A = list(map(int, input().split())) -c1 = Counter(A[::2]) -c2 = Counter(A[1::2]) +n = int(eval(input())) +V = list(map(int, input().split())) +c1 = Counter(V[::2]) +c2 = Counter(V[1::2]) -c1m = max(list(c1.items()), key=lambda x: x[1]) -c2m = max(list(c2.items()), key=lambda x: x[1]) -c1c2 = max(c for k, c in list(c2.items()) if c1m[0] != k) -c2c1 = max(c for k, c in list(c1.items()) if c2m[0] != k) -print((min(N - c1m[1] - c1c2, N - c2m[1] - c2c1))) +(x, cx), (_, cxx) = c1.most_common(2) +(y, cy), (_, cyy) = c2.most_common(2) +if x == y: +    print((n - max(cx + cyy, cy + cxx))) +else: +    print((n - cx - cy))