from collections import Counter



n=int(eval(input()))

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



l0 = l[::2]

l1 = l[1::2]

c0 = Counter(l0)

c1 = Counter(l1)

ll0 = len(l0)

ll1 = len(l1)



c0m = c0.most_common()[:2] + [(0, 0)]

c1m = c1.most_common()[:2] + [(0, 0)]



if c0m[0][0] != c1m[0][0]:

  print((ll0 - c0m[0][1] + ll1 - c1m[0][1]))

else:

  print((min(ll0 - c0m[1][1] + ll1 - c1m[0][1], ll0 - c0m[0][1] + ll1 - c1m[1][1])))
from collections import Counter



n,*l = list(map(int, open(0).read().split()))



c0 = Counter(l[::2]).most_common() + [(0, 0)]

c1 = Counter(l[1::2]).most_common() + [(0, 0)]



if c0[0][0] != c1[0][0]:

  print((n - c0[0][1] - c1[0][1]))

else:

  print((n - max(c0[1][1] + c1[0][1], c0[0][1] + c1[1][1])))
from collections import Counter

n = int(eval(input()))
l = list(map(int, input().split()))
l0 = l[::2]
l1 = l[1::2]
c0 = Counter(l0)
c1 = Counter(l1)
ll0 = len(l0)
ll1 = len(l1)
c0m = c0.most_common()[:2] + [(0, 0)]
c1m = c1.most_common()[:2] + [(0, 0)]
if c0m[0][0] != c1m[0][0]:
    print((ll0 - c0m[0][1] + ll1 - c1m[0][1]))
else:
    print((min(ll0 - c0m[1][1] + ll1 - c1m[0][1], ll0 - c0m[0][1] + ll1 - c1m[1][1])))

from collections import Counter

n, *l = list(map(int, open(0).read().split()))
c0 = Counter(l[::2]).most_common() + [(0, 0)]
c1 = Counter(l[1::2]).most_common() + [(0, 0)]
if c0[0][0] != c1[0][0]:
    print((n - c0[0][1] - c1[0][1]))
else:
    print((n - max(c0[1][1] + c1[0][1], c0[0][1] + c1[1][1])))

-n = int(eval(input())) -l = list(map(int, input().split())) -l0 = l[::2] -l1 = l[1::2] -c0 = Counter(l0) -c1 = Counter(l1) -ll0 = len(l0) -ll1 = len(l1) -c0m = c0.most_common()[:2] + [(0, 0)] -c1m = c1.most_common()[:2] + [(0, 0)] -if c0m[0][0] != c1m[0][0]: -    print((ll0 - c0m[0][1] + ll1 - c1m[0][1])) +n, *l = list(map(int, open(0).read().split())) +c0 = Counter(l[::2]).most_common() + [(0, 0)] +c1 = Counter(l[1::2]).most_common() + [(0, 0)] +if c0[0][0] != c1[0][0]: +    print((n - c0[0][1] - c1[0][1])) -    print((min(ll0 - c0m[1][1] + ll1 - c1m[0][1], ll0 - c0m[0][1] + ll1 - c1m[1][1]))) +    print((n - max(c0[1][1] + c1[0][1], c0[0][1] + c1[1][1])))