import collections



n = int(eval(input()))

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

a = v[::2]

b = v[1::2]

ac = collections.Counter(a)

bc = collections.Counter(b)

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

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

if ac[0][0] == bc[0][0]:

    if len(ac) == len(bc) and len(ac) == 1:

        print((ac[0][1]))

        exit()

    i = 0

    while ac[i][1] == bc[i][1]:

        i += 1

        if i == len(ac) - 1 or i == len(bc) - 1:

            break

    if ac[i][1] > bc[i][1]:

        ac.remove(ac[i])

        bc.remove(bc[0])

    elif ac[i][1] < bc[i][1]:

        ac.remove(ac[0])

        bc.remove(bc[i])

    else:

        ac.remove(ac[0])

        bc.remove(bc[1])

else:

    ac.remove(ac[0])

    bc.remove(bc[0])

ans = 0

for i in range(len(ac)):

    ans += ac[i][1]

for i in range(len(bc)):

    ans += bc[i][1]

print(ans)

import collections



n = int(eval(input()))

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

a = v[::2]

b = v[1::2]

ac = collections.Counter(a).most_common(2)

bc = collections.Counter(b).most_common(2)

if ac[0][0] != bc[0][0]:

    print((n - ac[0][1] - bc[0][1]))

else:

    if len(ac) == 1:

        print((n // 2))

    else:

        print((n - max(ac[0][1] + bc[1][1], ac[1][1] + bc[0][1])))
import collections

n = int(eval(input()))
v = list(map(int, input().split()))
a = v[::2]
b = v[1::2]
ac = collections.Counter(a)
bc = collections.Counter(b)
ac = sorted(list(ac.items()), key=lambda x: x[1], reverse=True)
bc = sorted(list(bc.items()), key=lambda x: x[1], reverse=True)
if ac[0][0] == bc[0][0]:
    if len(ac) == len(bc) and len(ac) == 1:
        print((ac[0][1]))
        exit()
    i = 0
    while ac[i][1] == bc[i][1]:
        i += 1
        if i == len(ac) - 1 or i == len(bc) - 1:
            break
    if ac[i][1] > bc[i][1]:
        ac.remove(ac[i])
        bc.remove(bc[0])
    elif ac[i][1] < bc[i][1]:
        ac.remove(ac[0])
        bc.remove(bc[i])
    else:
        ac.remove(ac[0])
        bc.remove(bc[1])
else:
    ac.remove(ac[0])
    bc.remove(bc[0])
ans = 0
for i in range(len(ac)):
    ans += ac[i][1]
for i in range(len(bc)):
    ans += bc[i][1]
print(ans)

import collections

n = int(eval(input()))
v = list(map(int, input().split()))
a = v[::2]
b = v[1::2]
ac = collections.Counter(a).most_common(2)
bc = collections.Counter(b).most_common(2)
if ac[0][0] != bc[0][0]:
    print((n - ac[0][1] - bc[0][1]))
else:
    if len(ac) == 1:
        print((n // 2))
    else:
        print((n - max(ac[0][1] + bc[1][1], ac[1][1] + bc[0][1])))

-ac = collections.Counter(a) -bc = collections.Counter(b) -ac = sorted(list(ac.items()), key=lambda x: x[1], reverse=True) -bc = sorted(list(bc.items()), key=lambda x: x[1], reverse=True) -if ac[0][0] == bc[0][0]: -    if len(ac) == len(bc) and len(ac) == 1: -        print((ac[0][1])) -        exit() -    i = 0 -    while ac[i][1] == bc[i][1]: -        i += 1 -        if i == len(ac) - 1 or i == len(bc) - 1: -            break -    if ac[i][1] > bc[i][1]: -        ac.remove(ac[i]) -        bc.remove(bc[0]) -    elif ac[i][1] < bc[i][1]: -        ac.remove(ac[0]) -        bc.remove(bc[i]) +ac = collections.Counter(a).most_common(2) +bc = collections.Counter(b).most_common(2) +if ac[0][0] != bc[0][0]: +    print((n - ac[0][1] - bc[0][1])) +else: +    if len(ac) == 1: +        print((n // 2)) -        ac.remove(ac[0]) -        bc.remove(bc[1]) -else: -    ac.remove(ac[0]) -    bc.remove(bc[0]) -ans = 0 -for i in range(len(ac)): -    ans += ac[i][1] -for i in range(len(bc)): -    ans += bc[i][1] -print(ans) +        print((n - max(ac[0][1] + bc[1][1], ac[1][1] + bc[0][1])))