import collections



n = int(eval(input()))

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

v1 = collections.Counter([x for i, x in enumerate(v) if i % 2 == 0]).most_common()

v2 = collections.Counter([x for i, x in enumerate(v) if i % 2 == 1]).most_common()

v1.append((0, 0))

v2.append((0, 0))

max_v1 = v1[0][1]

max_v2 = v2[0][1]



if v1[0][0] == v2[0][0]:

    if max_v1 == max_v2:

        if v1[1][1] >= v2[1][1]:

            max_v1 = v1[1][1]

        else:

            max_v2 = v2[1][1]

    elif max_v1 > max_v2:

        max_v2 = v2[1][1]

    elif max_v1 < max_v2:

        max_v1 = v1[1][1]



ans = 0

for a in v1:

    ans += a[1]



for a in v2:

    ans += a[1]



print((ans - max_v1 - max_v2))

import collections



n = int(eval(input()))

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

v1 = collections.Counter([x for i, x in enumerate(v) if i % 2 == 0]).most_common()

v2 = collections.Counter([x for i, x in enumerate(v) if i % 2 == 1]).most_common()

v1.append((0, 0))

v2.append((0, 0))



if v1[0][0] != v2[0][0]:

    print((n - v1[0][1] - v2[0][1]))

else:

    print((min(n - v1[0][1] - v2[1][1], n - v1[1][1] - v2[0][1])))

import collections

n = int(eval(input()))
v = list(map(int, input().split()))
v1 = collections.Counter([x for i, x in enumerate(v) if i % 2 == 0]).most_common()
v2 = collections.Counter([x for i, x in enumerate(v) if i % 2 == 1]).most_common()
v1.append((0, 0))
v2.append((0, 0))
max_v1 = v1[0][1]
max_v2 = v2[0][1]
if v1[0][0] == v2[0][0]:
    if max_v1 == max_v2:
        if v1[1][1] >= v2[1][1]:
            max_v1 = v1[1][1]
        else:
            max_v2 = v2[1][1]
    elif max_v1 > max_v2:
        max_v2 = v2[1][1]
    elif max_v1 < max_v2:
        max_v1 = v1[1][1]
ans = 0
for a in v1:
    ans += a[1]
for a in v2:
    ans += a[1]
print((ans - max_v1 - max_v2))

import collections

n = int(eval(input()))
v = list(map(int, input().split()))
v1 = collections.Counter([x for i, x in enumerate(v) if i % 2 == 0]).most_common()
v2 = collections.Counter([x for i, x in enumerate(v) if i % 2 == 1]).most_common()
v1.append((0, 0))
v2.append((0, 0))
if v1[0][0] != v2[0][0]:
    print((n - v1[0][1] - v2[0][1]))
else:
    print((min(n - v1[0][1] - v2[1][1], n - v1[1][1] - v2[0][1])))

-max_v1 = v1[0][1] -max_v2 = v2[0][1] -if v1[0][0] == v2[0][0]: -    if max_v1 == max_v2: -        if v1[1][1] >= v2[1][1]: -            max_v1 = v1[1][1] -        else: -            max_v2 = v2[1][1] -    elif max_v1 > max_v2: -        max_v2 = v2[1][1] -    elif max_v1 < max_v2: -        max_v1 = v1[1][1] -ans = 0 -for a in v1: -    ans += a[1] -for a in v2: -    ans += a[1] -print((ans - max_v1 - max_v2)) +if v1[0][0] != v2[0][0]: +    print((n - v1[0][1] - v2[0][1])) +else: +    print((min(n - v1[0][1] - v2[1][1], n - v1[1][1] - v2[0][1])))