n=int(eval(input()))

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

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

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

for t in sorted(v[0::2]):a[t][0]+=1

for t in sorted(v[1::2]):b[t][0]+=1

c=sorted(a)[::-1]

d=sorted(b)[::-1]

print((n-c[0][0]-[max(c[1][0],d[1][0]),d[0][0]][c[0][1]!=d[0][1]]))
n=int(eval(input()))

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

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

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

for t,u in zip(sorted(v[::2]),sorted(v[1::2])):a[t][0]+=1;b[u][0]+=1

a.sort(reverse=1)

b.sort(reverse=1)

print((n-a[0][0]-[max(a[1][0],b[1][0]),b[0][0]][a[0][1]!=b[0][1]]))
n = int(eval(input()))
v = list(map(int, input().split()))
a = [[0, i] for i in range(10**5 + 1)]
b = [[0, i] for i in range(10**5 + 1)]
for t in sorted(v[0::2]):
    a[t][0] += 1
for t in sorted(v[1::2]):
    b[t][0] += 1
c = sorted(a)[::-1]
d = sorted(b)[::-1]
print((n - c[0][0] - [max(c[1][0], d[1][0]), d[0][0]][c[0][1] != d[0][1]]))

n = int(eval(input()))
(*v,) = list(map(int, input().split()))
a = [[0, i] for i in range(10**5 + 1)]
b = [[0, i] for i in range(10**5 + 1)]
for t, u in zip(sorted(v[::2]), sorted(v[1::2])):
    a[t][0] += 1
    b[u][0] += 1
a.sort(reverse=1)
b.sort(reverse=1)
print((n - a[0][0] - [max(a[1][0], b[1][0]), b[0][0]][a[0][1] != b[0][1]]))

-v = list(map(int, input().split())) +(*v,) = list(map(int, input().split())) -for t in sorted(v[0::2]): +for t, u in zip(sorted(v[::2]), sorted(v[1::2])): -for t in sorted(v[1::2]): -    b[t][0] += 1 -c = sorted(a)[::-1] -d = sorted(b)[::-1] -print((n - c[0][0] - [max(c[1][0], d[1][0]), d[0][0]][c[0][1] != d[0][1]])) +    b[u][0] += 1 +a.sort(reverse=1) +b.sort(reverse=1) +print((n - a[0][0] - [max(a[1][0], b[1][0]), b[0][0]][a[0][1] != b[0][1]]))