maxn=10**5+10

n=int(eval(input()))

a=[None]*(n+10)

b=[0]*maxn

c=[0]*maxn

a[1:n+1]=input().split()



for i in range(1,n+1):

    a[i]=int(a[i])

    if i%2==0:

        b[a[i]]+=1

    else:

        c[a[i]]+=1



max1=max2=maxp=0

for i in range(1,maxn):

    if b[i]>=max1:

        max2=max1

        maxp=i

        max1=b[i]

    elif b[i]>=max2:

        max2=b[i]



ans=n

for i in range(1,maxn):

    res=((n+1)//2-c[i])

    if i==maxp:

        res+=n//2-max2

    else:

        res+=n//2-max1

    ans=min(ans,res)



print(ans)
maxn=10**5+10

n=int(eval(input()))

b=[0]*maxn

c=[0]*maxn

a=input().split()



for i in range(0,n):

    a[i]=int(a[i])

    if i%2==0:

        b[a[i]]+=1

    else:

        c[a[i]]+=1



max1=max(b)

maxp=b.index(max1)

del b[maxp]

max2=max(b)



ans=0

for i in range(0,maxn):

    ans=max(ans,c[i]+(max2 if i==maxp else max1))



print((n-ans))

maxn = 10**5 + 10
n = int(eval(input()))
a = [None] * (n + 10)
b = [0] * maxn
c = [0] * maxn
a[1 : n + 1] = input().split()
for i in range(1, n + 1):
    a[i] = int(a[i])
    if i % 2 == 0:
        b[a[i]] += 1
    else:
        c[a[i]] += 1
max1 = max2 = maxp = 0
for i in range(1, maxn):
    if b[i] >= max1:
        max2 = max1
        maxp = i
        max1 = b[i]
    elif b[i] >= max2:
        max2 = b[i]
ans = n
for i in range(1, maxn):
    res = (n + 1) // 2 - c[i]
    if i == maxp:
        res += n // 2 - max2
    else:
        res += n // 2 - max1
    ans = min(ans, res)
print(ans)

maxn = 10**5 + 10
n = int(eval(input()))
b = [0] * maxn
c = [0] * maxn
a = input().split()
for i in range(0, n):
    a[i] = int(a[i])
    if i % 2 == 0:
        b[a[i]] += 1
    else:
        c[a[i]] += 1
max1 = max(b)
maxp = b.index(max1)
del b[maxp]
max2 = max(b)
ans = 0
for i in range(0, maxn):
    ans = max(ans, c[i] + (max2 if i == maxp else max1))
print((n - ans))

-a = [None] * (n + 10) -a[1 : n + 1] = input().split() -for i in range(1, n + 1): +a = input().split() +for i in range(0, n): -max1 = max2 = maxp = 0 -for i in range(1, maxn): -    if b[i] >= max1: -        max2 = max1 -        maxp = i -        max1 = b[i] -    elif b[i] >= max2: -        max2 = b[i] -ans = n -for i in range(1, maxn): -    res = (n + 1) // 2 - c[i] -    if i == maxp: -        res += n // 2 - max2 -    else: -        res += n // 2 - max1 -    ans = min(ans, res) -print(ans) +max1 = max(b) +maxp = b.index(max1) +del b[maxp] +max2 = max(b) +ans = 0 +for i in range(0, maxn): +    ans = max(ans, c[i] + (max2 if i == maxp else max1)) +print((n - ans))