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



n = int(eval(input()))

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



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

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



if len(o) == 1:

    o.append([0, 0])

if len(e) == 1:

    e.append([0, 0])





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

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

n = int(eval(input()))
v = list(map(int, input().split()))
o = collections.Counter(v[0::2]).most_common(2)
e = collections.Counter(v[1::2]).most_common(2)
if len(o) == 1:
    o.append([0, 0])
if len(e) == 1:
    e.append([0, 0])
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)

-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) +o = collections.Counter(v[0::2]).most_common(2) +e = collections.Counter(v[1::2]).most_common(2) +if len(o) == 1: +    o.append([0, 0]) +if len(e) == 1: +    e.append([0, 0])