n = int(eval(input()))

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



O = {}

E = {}



for i in v[0::2]:

    if i in O:

        O[i] += 1

    else:

        O[i] = 1



for i in v[1::2]:

    if i in E:

        E[i] += 1

    else:

        E[i] = 1



o_candidate = [[0, 0], [0, 0]]

e_candidate = [[0, 0], [0, 0]]



for i, j in list(O.items()):

    if j >= o_candidate[0][1]:

        o_candidate[1] = o_candidate[0]

        o_candidate[0] = [i, j]

    elif j >= o_candidate[1][1]:

        o_candidate[1] = [i, j]



for i, j in list(E.items()):

    if j > e_candidate[0][1]:

        e_candidate[1] = e_candidate[0]

        e_candidate[0] = [i, j]

    elif j >= o_candidate[1][1]:

        o_candidate[1] = [i, j]



if o_candidate[0][0] != e_candidate[0][0]:

    ans = n - o_candidate[0][1] - e_candidate[0][1]

else:

    ans = min(n - o_candidate[0][1] - e_candidate[1][1],

              n - o_candidate[1][1] - e_candidate[0][1])



print(ans)

import collections



n = int(eval(input()))

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



O = collections.Counter(v[0::2])

E = collections.Counter(v[1::2])



def get_candidate(F):

    c = [[0, 0], [0, 0]]

    for i, j in list(F.items()):

        if j >= c[0][1]:

            c[1] = c[0]

            c[0] = [i, j]

        elif j >= c[1][1]:

            c[1] = [i, j]

    return c



o = get_candidate(O)

e = get_candidate(E)



if o[0][0] != e[0][0]:

    ans = n - o[0][1] - e[0][1]

else:

    ans = min(n - o[0][1] - e[1][1], n - o[1][1] - e[0][1])



print(ans)
n = int(eval(input()))
v = list(map(int, input().split()))
O = {}
E = {}
for i in v[0::2]:
    if i in O:
        O[i] += 1
    else:
        O[i] = 1
for i in v[1::2]:
    if i in E:
        E[i] += 1
    else:
        E[i] = 1
o_candidate = [[0, 0], [0, 0]]
e_candidate = [[0, 0], [0, 0]]
for i, j in list(O.items()):
    if j >= o_candidate[0][1]:
        o_candidate[1] = o_candidate[0]
        o_candidate[0] = [i, j]
    elif j >= o_candidate[1][1]:
        o_candidate[1] = [i, j]
for i, j in list(E.items()):
    if j > e_candidate[0][1]:
        e_candidate[1] = e_candidate[0]
        e_candidate[0] = [i, j]
    elif j >= o_candidate[1][1]:
        o_candidate[1] = [i, j]
if o_candidate[0][0] != e_candidate[0][0]:
    ans = n - o_candidate[0][1] - e_candidate[0][1]
else:
    ans = min(
        n - o_candidate[0][1] - e_candidate[1][1],
        n - o_candidate[1][1] - e_candidate[0][1],
    )
print(ans)

import collections

n = int(eval(input()))
v = list(map(int, input().split()))
O = collections.Counter(v[0::2])
E = collections.Counter(v[1::2])


def get_candidate(F):
    c = [[0, 0], [0, 0]]
    for i, j in list(F.items()):
        if j >= c[0][1]:
            c[1] = c[0]
            c[0] = [i, j]
        elif j >= c[1][1]:
            c[1] = [i, j]
    return c


o = get_candidate(O)
e = get_candidate(E)
if o[0][0] != e[0][0]:
    ans = n - o[0][1] - e[0][1]
else:
    ans = min(n - o[0][1] - e[1][1], n - o[1][1] - e[0][1])
print(ans)

+import collections + -O = {} -E = {} -for i in v[0::2]: -    if i in O: -        O[i] += 1 -    else: -        O[i] = 1 -for i in v[1::2]: -    if i in E: -        E[i] += 1 -    else: -        E[i] = 1 -o_candidate = [[0, 0], [0, 0]] -e_candidate = [[0, 0], [0, 0]] -for i, j in list(O.items()): -    if j >= o_candidate[0][1]: -        o_candidate[1] = o_candidate[0] -        o_candidate[0] = [i, j] -    elif j >= o_candidate[1][1]: -        o_candidate[1] = [i, j] -for i, j in list(E.items()): -    if j > e_candidate[0][1]: -        e_candidate[1] = e_candidate[0] -        e_candidate[0] = [i, j] -    elif j >= o_candidate[1][1]: -        o_candidate[1] = [i, j] -if o_candidate[0][0] != e_candidate[0][0]: -    ans = n - o_candidate[0][1] - e_candidate[0][1] +O = collections.Counter(v[0::2]) +E = collections.Counter(v[1::2]) + + +def get_candidate(F): +    c = [[0, 0], [0, 0]] +    for i, j in list(F.items()): +        if j >= c[0][1]: +            c[1] = c[0] +            c[0] = [i, j] +        elif j >= c[1][1]: +            c[1] = [i, j] +    return c + + +o = get_candidate(O) +e = get_candidate(E) +if o[0][0] != e[0][0]: +    ans = n - o[0][1] - e[0][1] -    ans = min( -        n - o_candidate[0][1] - e_candidate[1][1], -        n - o_candidate[1][1] - e_candidate[0][1], -    ) +    ans = min(n - o[0][1] - e[1][1], n - o[1][1] - e[0][1])