n=int(eval(input()))

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

w=sorted(a for a in v[0::2])

x=sorted(a for a in v[1::2])

a=[[0,i]for i in range(10**5+1)]

b=[[0,i]for i in range(10**5+1)]

for t in w:

    a[t][0]+=1

for t in x:

    b[t][0]+=1

c=sorted(a)

d=sorted(b)

e=c[len(c)-1][0]

i=c[len(c)-1][1]

f=d[len(d)-1][0]

g=c[len(c)-1][0]

h=d[len(d)-1][0]

for t in range(len(c)):

    if i!=d[len(d)-1][1]:break

    e=c[len(c)-t-1][0]

    i=c[len(c)-t-1][1]

i=d[len(d)-1][1]

for t in range(len(d)):

    if i!=c[len(c)-1][1]:break

    g=d[len(d)-t-1][0]

    i=d[len(d)-t-1][1]

print((min(n-e-f,n-g-h)))
from collections import*

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

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

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

if a[0][0]==b[0][0]:

    if len(a)>1and len(b)>1:

        print((min(n-a[0][1]-b[1][1],n-a[1][1]-b[0][1])))

    elif len(a)>1:

        print((n-a[1][1]-b[0][1]))

    elif len(b)>1:

        print((n-a[0][1]-b[1][1]))

    else:

        print((n//2))

else:

    print((n-a[0][1]-b[0][1]))
n = int(eval(input()))
v = list(map(int, input().split()))
w = sorted(a for a in v[0::2])
x = sorted(a for a in v[1::2])
a = [[0, i] for i in range(10**5 + 1)]
b = [[0, i] for i in range(10**5 + 1)]
for t in w:
    a[t][0] += 1
for t in x:
    b[t][0] += 1
c = sorted(a)
d = sorted(b)
e = c[len(c) - 1][0]
i = c[len(c) - 1][1]
f = d[len(d) - 1][0]
g = c[len(c) - 1][0]
h = d[len(d) - 1][0]
for t in range(len(c)):
    if i != d[len(d) - 1][1]:
        break
    e = c[len(c) - t - 1][0]
    i = c[len(c) - t - 1][1]
i = d[len(d) - 1][1]
for t in range(len(d)):
    if i != c[len(c) - 1][1]:
        break
    g = d[len(d) - t - 1][0]
    i = d[len(d) - t - 1][1]
print((min(n - e - f, n - g - h)))

from collections import *

n, *v = list(map(int, open(0).read().split()))
a = Counter(v[::2]).most_common()
b = Counter(v[1::2]).most_common()
if a[0][0] == b[0][0]:
    if len(a) > 1 and len(b) > 1:
        print((min(n - a[0][1] - b[1][1], n - a[1][1] - b[0][1])))
    elif len(a) > 1:
        print((n - a[1][1] - b[0][1]))
    elif len(b) > 1:
        print((n - a[0][1] - b[1][1]))
    else:
        print((n // 2))
else:
    print((n - a[0][1] - b[0][1]))

-n = int(eval(input())) -v = list(map(int, input().split())) -w = sorted(a for a in v[0::2]) -x = sorted(a for a in v[1::2]) -a = [[0, i] for i in range(10**5 + 1)] -b = [[0, i] for i in range(10**5 + 1)] -for t in w: -    a[t][0] += 1 -for t in x: -    b[t][0] += 1 -c = sorted(a) -d = sorted(b) -e = c[len(c) - 1][0] -i = c[len(c) - 1][1] -f = d[len(d) - 1][0] -g = c[len(c) - 1][0] -h = d[len(d) - 1][0] -for t in range(len(c)): -    if i != d[len(d) - 1][1]: -        break -    e = c[len(c) - t - 1][0] -    i = c[len(c) - t - 1][1] -i = d[len(d) - 1][1] -for t in range(len(d)): -    if i != c[len(c) - 1][1]: -        break -    g = d[len(d) - t - 1][0] -    i = d[len(d) - t - 1][1] -print((min(n - e - f, n - g - h))) +from collections import * + +n, *v = list(map(int, open(0).read().split())) +a = Counter(v[::2]).most_common() +b = Counter(v[1::2]).most_common() +if a[0][0] == b[0][0]: +    if len(a) > 1 and len(b) > 1: +        print((min(n - a[0][1] - b[1][1], n - a[1][1] - b[0][1]))) +    elif len(a) > 1: +        print((n - a[1][1] - b[0][1])) +    elif len(b) > 1: +        print((n - a[0][1] - b[1][1])) +    else: +        print((n // 2)) +else: +    print((n - a[0][1] - b[0][1]))