from collections import Counter



n = int(eval(input()))

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

v1 = sorted(list(Counter(v[::2]).items()), key=lambda x: x[1], reverse=True)

v2 = sorted(list(Counter(v[1::2]).items()), key=lambda x: x[1], reverse=True)

v1.append((0, 0))

v2.append((0, 0))

if v1[0][0] != v2[0][0]:

    print((n - v1[0][1] - v2[0][1]))

else:

    print((min(n - v1[0][1] - v2[1][1], n - v1[1][1] - v2[0][1])))
from collections import Counter



n = int(eval(input()))

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

v1 = Counter(v[::2]).most_common()

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

v1.append((0, 0))

v2.append((0, 0))

if v1[0][0] != v2[0][0]:

    print((n - v1[0][1] - v2[0][1]))

else:

    print((min(n - v1[0][1] - v2[1][1], n - v1[1][1] - v2[0][1])))
from collections import Counter

n = int(eval(input()))
v = list(map(int, input().split()))
v1 = sorted(list(Counter(v[::2]).items()), key=lambda x: x[1], reverse=True)
v2 = sorted(list(Counter(v[1::2]).items()), key=lambda x: x[1], reverse=True)
v1.append((0, 0))
v2.append((0, 0))
if v1[0][0] != v2[0][0]:
    print((n - v1[0][1] - v2[0][1]))
else:
    print((min(n - v1[0][1] - v2[1][1], n - v1[1][1] - v2[0][1])))

from collections import Counter

n = int(eval(input()))
v = list(map(int, input().split()))
v1 = Counter(v[::2]).most_common()
v2 = Counter(v[1::2]).most_common()
v1.append((0, 0))
v2.append((0, 0))
if v1[0][0] != v2[0][0]:
    print((n - v1[0][1] - v2[0][1]))
else:
    print((min(n - v1[0][1] - v2[1][1], n - v1[1][1] - v2[0][1])))

-v1 = sorted(list(Counter(v[::2]).items()), key=lambda x: x[1], reverse=True) -v2 = sorted(list(Counter(v[1::2]).items()), key=lambda x: x[1], reverse=True) +v1 = Counter(v[::2]).most_common() +v2 = Counter(v[1::2]).most_common()