from collections import Counter

n = int(input().strip())

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

cnt1 = Counter(a[::2]).most_common(2)

c11, c12 = (cnt1 if len(cnt1) == 2 else cnt1+[('', 0)])

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

c21, c22 = (cnt2 if len(cnt2) == 2 else cnt2+[('', 0)])



if c11[0] != c21[0]:

    print((n - c11[1] - c21[1]))

else:

    print((n - max(c11[1]+c22[1], c12[1]+c21[1])))
from collections import Counter

n = int(input().strip())

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

cnt1 = Counter(a[::2]).most_common(2)

c11, c12 = (cnt1 if len(cnt1) == 2 else cnt1+[('', 0)])

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

c21, c22 = (cnt2 if len(cnt2) == 2 else cnt2+[('', 0)])



if c11[0] != c21[0]:

    print((n - c11[1] - c21[1]))

else:

    print((n - max(c11[1]+c22[1], c12[1]+c21[1])))

print()
from collections import Counter

n = int(input().strip())
a = list(map(int, input().strip().split()))
cnt1 = Counter(a[::2]).most_common(2)
c11, c12 = cnt1 if len(cnt1) == 2 else cnt1 + [("", 0)]
cnt2 = Counter(a[1::2]).most_common(2)
c21, c22 = cnt2 if len(cnt2) == 2 else cnt2 + [("", 0)]
if c11[0] != c21[0]:
    print((n - c11[1] - c21[1]))
else:
    print((n - max(c11[1] + c22[1], c12[1] + c21[1])))

from collections import Counter

n = int(input().strip())
a = list(map(int, input().strip().split()))
cnt1 = Counter(a[::2]).most_common(2)
c11, c12 = cnt1 if len(cnt1) == 2 else cnt1 + [("", 0)]
cnt2 = Counter(a[1::2]).most_common(2)
c21, c22 = cnt2 if len(cnt2) == 2 else cnt2 + [("", 0)]
if c11[0] != c21[0]:
    print((n - c11[1] - c21[1]))
else:
    print((n - max(c11[1] + c22[1], c12[1] + c21[1])))
print()

+print()