from collections import Counter

n = int(eval(input()))

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

evenL = []

oddL = []

for i, v in enumerate(s):

  if i % 2 == 0:

    evenL.append(v)

  else:

    oddL.append(v)

    

evenLc = Counter(evenL)

oddLc = Counter(oddL)



evenLcs = sorted(list(evenLc.items()), key=lambda x: -x[1])

oddLcs = sorted(list(oddLc.items()), key=lambda x: -x[1])



if evenLcs[0][0] != oddLcs[0][0]:

  print((n - evenLcs[0][1] - oddLcs[0][1]))

else:

  if len(evenLc) == 1 and len(oddLc) == 1:

    print((n - len(evenL)))

    exit()

  if evenLcs[0][1] > oddLcs[0][1]:

    print((n - evenLcs[0][1] - oddLcs[1][1]))

  elif evenLcs[0][1] < oddLcs[0][1]:

    print((n - evenLcs[1][1] - oddLcs[0][1]))

  else:

    print((n - evenLcs[0][1] - max(evenLcs[1][1], oddLcs[1][1])))
from collections import Counter as C

n = int(eval(input()))

V = list(input().split())



V1 = C(V[::2]).most_common()

V2 = C(V[1::2]).most_common()



if V1[0][0] != V2[0][0]:

  ans = n - (V1[0][1] + V2[0][1])

else:

  l = V1[0][1] + V2[1][1] if len(V2) > 1 else V1[0][1]

  r = V1[1][1] + V2[0][1] if len(V1) > 1 else V2[0][1] 

  if l >= r:

    ans = n - l

  else:

    ans = n - r

print(ans)
from collections import Counter

n = int(eval(input()))
s = list(map(int, input().split()))
evenL = []
oddL = []
for i, v in enumerate(s):
    if i % 2 == 0:
        evenL.append(v)
    else:
        oddL.append(v)
evenLc = Counter(evenL)
oddLc = Counter(oddL)
evenLcs = sorted(list(evenLc.items()), key=lambda x: -x[1])
oddLcs = sorted(list(oddLc.items()), key=lambda x: -x[1])
if evenLcs[0][0] != oddLcs[0][0]:
    print((n - evenLcs[0][1] - oddLcs[0][1]))
else:
    if len(evenLc) == 1 and len(oddLc) == 1:
        print((n - len(evenL)))
        exit()
    if evenLcs[0][1] > oddLcs[0][1]:
        print((n - evenLcs[0][1] - oddLcs[1][1]))
    elif evenLcs[0][1] < oddLcs[0][1]:
        print((n - evenLcs[1][1] - oddLcs[0][1]))
    else:
        print((n - evenLcs[0][1] - max(evenLcs[1][1], oddLcs[1][1])))

from collections import Counter as C

n = int(eval(input()))
V = list(input().split())
V1 = C(V[::2]).most_common()
V2 = C(V[1::2]).most_common()
if V1[0][0] != V2[0][0]:
    ans = n - (V1[0][1] + V2[0][1])
else:
    l = V1[0][1] + V2[1][1] if len(V2) > 1 else V1[0][1]
    r = V1[1][1] + V2[0][1] if len(V1) > 1 else V2[0][1]
    if l >= r:
        ans = n - l
    else:
        ans = n - r
print(ans)

-from collections import Counter +from collections import Counter as C -s = list(map(int, input().split())) -evenL = [] -oddL = [] -for i, v in enumerate(s): -    if i % 2 == 0: -        evenL.append(v) +V = list(input().split()) +V1 = C(V[::2]).most_common() +V2 = C(V[1::2]).most_common() +if V1[0][0] != V2[0][0]: +    ans = n - (V1[0][1] + V2[0][1]) +else: +    l = V1[0][1] + V2[1][1] if len(V2) > 1 else V1[0][1] +    r = V1[1][1] + V2[0][1] if len(V1) > 1 else V2[0][1] +    if l >= r: +        ans = n - l -        oddL.append(v) -evenLc = Counter(evenL) -oddLc = Counter(oddL) -evenLcs = sorted(list(evenLc.items()), key=lambda x: -x[1]) -oddLcs = sorted(list(oddLc.items()), key=lambda x: -x[1]) -if evenLcs[0][0] != oddLcs[0][0]: -    print((n - evenLcs[0][1] - oddLcs[0][1])) -else: -    if len(evenLc) == 1 and len(oddLc) == 1: -        print((n - len(evenL))) -        exit() -    if evenLcs[0][1] > oddLcs[0][1]: -        print((n - evenLcs[0][1] - oddLcs[1][1])) -    elif evenLcs[0][1] < oddLcs[0][1]: -        print((n - evenLcs[1][1] - oddLcs[0][1])) -    else: -        print((n - evenLcs[0][1] - max(evenLcs[1][1], oddLcs[1][1]))) +        ans = n - r +print(ans)