from collections import defaultdict

n = int(eval(input()))

A = [int(x) for x in input().split()]

even = A[0::2]

odd = A[1::2]

EC = defaultdict(int)

EC[0] = 0

OC = defaultdict(int)

OC[0] = 0

for e in even:

  EC[e] += 1

for o in odd:

  OC[o] += 1

E = sorted([[v, k] for k, v in list(EC.items())], reverse=True)

O = sorted([[v, k] for k, v in list(OC.items())], reverse=True)

if E[0][1] != O[0][1]:

  print((n - E[0][0] - O[0][0]))

elif E[1][0] >= O[1][0]:

  print((n - E[1][0] - O[0][0]))

else:

  print((n - E[0][0] - O[1][0]))



#sample code.
n=int(eval(input()))

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

a=v[0::2]

b=v[1::2]

c=dict()

d=dict()



for i in a:

  if i in c:

    c[i]+=1

  else:

    c[i]=1

for j in b:

  if j in d:

    d[j]+=1

  else:

    d[j]=1



e=sorted([[w,v] for v,w in list(c.items())],reverse=True)

f=sorted([[w,v] for v,w in list(d.items())],reverse=True)



if len(set(a))==len(set(b))==1 and e[0][1]==f[0][1] and e[0][0]==f[0][0]:

  print((min(len(a),len(b))))

elif e[0][1]!=f[0][1]:

  print((n-e[0][0]-f[0][0]))

elif e[0][0]>f[0][0]:

  print((n-e[0][0]-f[1][0]))

elif e[0][0]<f[0][0]:

  print((n-e[1][0]-f[0][0]))

elif e[0][0]==f[0][0] and e[0][1]==f[0][1]:

  if e[1][0]>f[1][0]:

    print((n-e[1][0]-f[0][0]))

  else:

    print((n-e[0][0]-f[1][0]))
from collections import defaultdict

n = int(eval(input()))
A = [int(x) for x in input().split()]
even = A[0::2]
odd = A[1::2]
EC = defaultdict(int)
EC[0] = 0
OC = defaultdict(int)
OC[0] = 0
for e in even:
    EC[e] += 1
for o in odd:
    OC[o] += 1
E = sorted([[v, k] for k, v in list(EC.items())], reverse=True)
O = sorted([[v, k] for k, v in list(OC.items())], reverse=True)
if E[0][1] != O[0][1]:
    print((n - E[0][0] - O[0][0]))
elif E[1][0] >= O[1][0]:
    print((n - E[1][0] - O[0][0]))
else:
    print((n - E[0][0] - O[1][0]))
# sample code.

n = int(eval(input()))
v = list(map(int, input().split()))
a = v[0::2]
b = v[1::2]
c = dict()
d = dict()
for i in a:
    if i in c:
        c[i] += 1
    else:
        c[i] = 1
for j in b:
    if j in d:
        d[j] += 1
    else:
        d[j] = 1
e = sorted([[w, v] for v, w in list(c.items())], reverse=True)
f = sorted([[w, v] for v, w in list(d.items())], reverse=True)
if len(set(a)) == len(set(b)) == 1 and e[0][1] == f[0][1] and e[0][0] == f[0][0]:
    print((min(len(a), len(b))))
elif e[0][1] != f[0][1]:
    print((n - e[0][0] - f[0][0]))
elif e[0][0] > f[0][0]:
    print((n - e[0][0] - f[1][0]))
elif e[0][0] < f[0][0]:
    print((n - e[1][0] - f[0][0]))
elif e[0][0] == f[0][0] and e[0][1] == f[0][1]:
    if e[1][0] > f[1][0]:
        print((n - e[1][0] - f[0][0]))
    else:
        print((n - e[0][0] - f[1][0]))

-from collections import defaultdict - -A = [int(x) for x in input().split()] -even = A[0::2] -odd = A[1::2] -EC = defaultdict(int) -EC[0] = 0 -OC = defaultdict(int) -OC[0] = 0 -for e in even: -    EC[e] += 1 -for o in odd: -    OC[o] += 1 -E = sorted([[v, k] for k, v in list(EC.items())], reverse=True) -O = sorted([[v, k] for k, v in list(OC.items())], reverse=True) -if E[0][1] != O[0][1]: -    print((n - E[0][0] - O[0][0])) -elif E[1][0] >= O[1][0]: -    print((n - E[1][0] - O[0][0])) -else: -    print((n - E[0][0] - O[1][0])) -# sample code. +v = list(map(int, input().split())) +a = v[0::2] +b = v[1::2] +c = dict() +d = dict() +for i in a: +    if i in c: +        c[i] += 1 +    else: +        c[i] = 1 +for j in b: +    if j in d: +        d[j] += 1 +    else: +        d[j] = 1 +e = sorted([[w, v] for v, w in list(c.items())], reverse=True) +f = sorted([[w, v] for v, w in list(d.items())], reverse=True) +if len(set(a)) == len(set(b)) == 1 and e[0][1] == f[0][1] and e[0][0] == f[0][0]: +    print((min(len(a), len(b)))) +elif e[0][1] != f[0][1]: +    print((n - e[0][0] - f[0][0])) +elif e[0][0] > f[0][0]: +    print((n - e[0][0] - f[1][0])) +elif e[0][0] < f[0][0]: +    print((n - e[1][0] - f[0][0])) +elif e[0][0] == f[0][0] and e[0][1] == f[0][1]: +    if e[1][0] > f[1][0]: +        print((n - e[1][0] - f[0][0])) +    else: +        print((n - e[0][0] - f[1][0]))