n = int(eval(input()))

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

ma = {}

mb = {}

for i in range(0, n, 2):

    lst[i] in ma

    if lst[i] in ma:

        ma[lst[i]] += 1

    else:

        ma[lst[i]] = 1

    lst[i+1] in mb

    if lst[i+1] in mb:

        mb[lst[i+1]] += 1

    else:

        mb[lst[i+1]] = 1

if max(ma, key=ma.get) != max(mb, key=mb.get):

    d = n - max(ma.values()) - max(mb.values())

else:

    ma2 = max(ma.values())

    mb2 = max(mb.values())

    ma[max(ma, key=ma.get)] = 0

    mb[max(mb, key=mb.get)] = 0

    d1 = n - ma2 - max(mb.values())

    d2 = n - max(ma.values()) - mb2

    d = min(d1, d2)

print(d)
n = int(eval(input()))

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

m1 = {}

m2 = {}

for i in range(0, n, 2):

    if lst[i] in m1:

        m1[lst[i]] += 1

    else:

        m1[lst[i]] = 1

    if lst[i+1] in m2:

        m2[lst[i+1]] += 1

    else:

        m2[lst[i+1]] = 1

if max(m1, key=m1.get) != max(m2, key=m2.get):

    mm = n - max(m1.values()) - max(m2.values())

else:

    mm1 = max(m1.values())

    mm2 = max(m2.values())

    m1[max(m1, key=m1.get)] = 0

    m2[max(m2, key=m2.get)] = 0

    mm = min(n - max(m1.values()) - mm2, n - max(m2.values()) - mm1) 

print(mm)
n = int(eval(input()))
lst = list(map(int, input().split()))
ma = {}
mb = {}
for i in range(0, n, 2):
    lst[i] in ma
    if lst[i] in ma:
        ma[lst[i]] += 1
    else:
        ma[lst[i]] = 1
    lst[i + 1] in mb
    if lst[i + 1] in mb:
        mb[lst[i + 1]] += 1
    else:
        mb[lst[i + 1]] = 1
if max(ma, key=ma.get) != max(mb, key=mb.get):
    d = n - max(ma.values()) - max(mb.values())
else:
    ma2 = max(ma.values())
    mb2 = max(mb.values())
    ma[max(ma, key=ma.get)] = 0
    mb[max(mb, key=mb.get)] = 0
    d1 = n - ma2 - max(mb.values())
    d2 = n - max(ma.values()) - mb2
    d = min(d1, d2)
print(d)

n = int(eval(input()))
lst = list(map(int, input().split()))
m1 = {}
m2 = {}
for i in range(0, n, 2):
    if lst[i] in m1:
        m1[lst[i]] += 1
    else:
        m1[lst[i]] = 1
    if lst[i + 1] in m2:
        m2[lst[i + 1]] += 1
    else:
        m2[lst[i + 1]] = 1
if max(m1, key=m1.get) != max(m2, key=m2.get):
    mm = n - max(m1.values()) - max(m2.values())
else:
    mm1 = max(m1.values())
    mm2 = max(m2.values())
    m1[max(m1, key=m1.get)] = 0
    m2[max(m2, key=m2.get)] = 0
    mm = min(n - max(m1.values()) - mm2, n - max(m2.values()) - mm1)
print(mm)

-ma = {} -mb = {} +m1 = {} +m2 = {} -    lst[i] in ma -    if lst[i] in ma: -        ma[lst[i]] += 1 +    if lst[i] in m1: +        m1[lst[i]] += 1 -        ma[lst[i]] = 1 -    lst[i + 1] in mb -    if lst[i + 1] in mb: -        mb[lst[i + 1]] += 1 +        m1[lst[i]] = 1 +    if lst[i + 1] in m2: +        m2[lst[i + 1]] += 1 -        mb[lst[i + 1]] = 1 -if max(ma, key=ma.get) != max(mb, key=mb.get): -    d = n - max(ma.values()) - max(mb.values()) +        m2[lst[i + 1]] = 1 +if max(m1, key=m1.get) != max(m2, key=m2.get): +    mm = n - max(m1.values()) - max(m2.values()) -    ma2 = max(ma.values()) -    mb2 = max(mb.values()) -    ma[max(ma, key=ma.get)] = 0 -    mb[max(mb, key=mb.get)] = 0 -    d1 = n - ma2 - max(mb.values()) -    d2 = n - max(ma.values()) - mb2 -    d = min(d1, d2) -print(d) +    mm1 = max(m1.values()) +    mm2 = max(m2.values()) +    m1[max(m1, key=m1.get)] = 0 +    m2[max(m2, key=m2.get)] = 0 +    mm = min(n - max(m1.values()) - mm2, n - max(m2.values()) - mm1) +print(mm)