n = int(eval(input()))

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

Ce = {}

Co = {}

for i in range(n):

    v = V[i]

    if i%2==0:

        if v not in Ce:

            Ce[v] = 0

        Ce[v] += 1

    else:

        if v not in Co:

            Co[v] = 0

        Co[v] += 1

Ce = sorted(list(Ce.items()),key=lambda x:x[1],reverse=True)

Co = sorted(list(Co.items()),key=lambda x:x[1],reverse=True)

if len(Ce)==1 and len(Co)==1 and Ce[0][0]==Co[0][0]:

    m = n//2

else:

    if Ce[0][0]!=Co[0][0]:

        m = n-Ce[0][1]-Co[0][1]

    else:

        m1 = n-Ce[1][1]-Co[0][1]

        m2 = n-Ce[0][1]-Co[1][1]

        m = min(m1,m2)

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

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

Ce = {}

Co = {}

for i in range(n):

    v = V[i]

    if i%2==0:

        if v not in Ce:

            Ce[v]=0

        Ce[v] += 1

    else:

        if v not in Co:

            Co[v]=0

        Co[v] += 1

Ce = sorted(list(Ce.items()),key=lambda x:x[1],reverse=True)

Co = sorted(list(Co.items()),key=lambda x:x[1],reverse=True)

if Ce[0][0]!=Co[0][0]:

    cnt = 0

    for i in range(1,len(Ce)):

        cnt += Ce[i][1]

    for i in range(1,len(Co)):

        cnt += Co[i][1]

    print(cnt)

else:

    cnt1 = 0

    for i in range(1,len(Ce)):

        cnt1 += Ce[i][1]

    if Ce[0][1]>n//2:

        cnt1 += Ce[0][1]-n//2

    cnt1 += Co[0][1]

    for i in range(2,len(Co)):

        cnt1 += Co[i][1]

    cnt2 = 0

    for i in range(1,len(Co)):

        cnt2 += Co[i][1]

    if Co[0][1]>n//2:

        cnt2 += Co[0][1]-n//2

    cnt2 += Ce[0][1]

    for i in range(2,len(Ce)):

        cnt2 += Ce[i][1]

    print((min(cnt1,cnt2)))
n = int(eval(input()))
V = list(map(int, input().split()))
Ce = {}
Co = {}
for i in range(n):
    v = V[i]
    if i % 2 == 0:
        if v not in Ce:
            Ce[v] = 0
        Ce[v] += 1
    else:
        if v not in Co:
            Co[v] = 0
        Co[v] += 1
Ce = sorted(list(Ce.items()), key=lambda x: x[1], reverse=True)
Co = sorted(list(Co.items()), key=lambda x: x[1], reverse=True)
if len(Ce) == 1 and len(Co) == 1 and Ce[0][0] == Co[0][0]:
    m = n // 2
else:
    if Ce[0][0] != Co[0][0]:
        m = n - Ce[0][1] - Co[0][1]
    else:
        m1 = n - Ce[1][1] - Co[0][1]
        m2 = n - Ce[0][1] - Co[1][1]
        m = min(m1, m2)
print(m)

n = int(eval(input()))
V = list(map(int, input().split()))
Ce = {}
Co = {}
for i in range(n):
    v = V[i]
    if i % 2 == 0:
        if v not in Ce:
            Ce[v] = 0
        Ce[v] += 1
    else:
        if v not in Co:
            Co[v] = 0
        Co[v] += 1
Ce = sorted(list(Ce.items()), key=lambda x: x[1], reverse=True)
Co = sorted(list(Co.items()), key=lambda x: x[1], reverse=True)
if Ce[0][0] != Co[0][0]:
    cnt = 0
    for i in range(1, len(Ce)):
        cnt += Ce[i][1]
    for i in range(1, len(Co)):
        cnt += Co[i][1]
    print(cnt)
else:
    cnt1 = 0
    for i in range(1, len(Ce)):
        cnt1 += Ce[i][1]
    if Ce[0][1] > n // 2:
        cnt1 += Ce[0][1] - n // 2
    cnt1 += Co[0][1]
    for i in range(2, len(Co)):
        cnt1 += Co[i][1]
    cnt2 = 0
    for i in range(1, len(Co)):
        cnt2 += Co[i][1]
    if Co[0][1] > n // 2:
        cnt2 += Co[0][1] - n // 2
    cnt2 += Ce[0][1]
    for i in range(2, len(Ce)):
        cnt2 += Ce[i][1]
    print((min(cnt1, cnt2)))

-if len(Ce) == 1 and len(Co) == 1 and Ce[0][0] == Co[0][0]: -    m = n // 2 +if Ce[0][0] != Co[0][0]: +    cnt = 0 +    for i in range(1, len(Ce)): +        cnt += Ce[i][1] +    for i in range(1, len(Co)): +        cnt += Co[i][1] +    print(cnt) -    if Ce[0][0] != Co[0][0]: -        m = n - Ce[0][1] - Co[0][1] -    else: -        m1 = n - Ce[1][1] - Co[0][1] -        m2 = n - Ce[0][1] - Co[1][1] -        m = min(m1, m2) -print(m) +    cnt1 = 0 +    for i in range(1, len(Ce)): +        cnt1 += Ce[i][1] +    if Ce[0][1] > n // 2: +        cnt1 += Ce[0][1] - n // 2 +    cnt1 += Co[0][1] +    for i in range(2, len(Co)): +        cnt1 += Co[i][1] +    cnt2 = 0 +    for i in range(1, len(Co)): +        cnt2 += Co[i][1] +    if Co[0][1] > n // 2: +        cnt2 += Co[0][1] - n // 2 +    cnt2 += Ce[0][1] +    for i in range(2, len(Ce)): +        cnt2 += Ce[i][1] +    print((min(cnt1, cnt2)))