from collections import Counter

n = int(eval(input()))

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



c1 = Counter(V[::2])

c2 = Counter(V[1::2])

# print('c1, c2', c1, c2)



c1_items = sorted(list(c1.items()), key=lambda x: -x[1])

c2_items = sorted(list(c2.items()), key=lambda x: -x[1])

c1_max = c1_items[0][1]

c2_max = c2_items[0][1]

c1_second = 0

c2_second = 0



c1_max_group = set()

for key, value in c1_items:

    if value == c1_max:

        c1_max_group.add(key)

    else:

        c1_second = value

        break

c2_max_group = set()

for key, value in c2_items:

    if value == c2_max:

        c2_max_group.add(key)

    else:

        c2_second = value

        break



# print(c1_max_group, c1_max, c1_second)

# print(c2_max_group, c2_max, c2_second)

if len(c1_max_group) == 1 and len(c2_max_group) == 1 and list(

        c1_max_group)[0] in c2_max_group:

    v1 = n - c1_max - c2_second

    v2 = n - c1_second - c2_max

    ans = min(v1, v2)

else:

    ans = n - c1_max - c2_max

print(ans)

from collections import Counter

n = int(eval(input()))

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



c1 = Counter(V[::2])

c2 = Counter(V[1::2])

c1_items = sorted(list(c1.items()), key=lambda x: -x[1])

c2_items = sorted(list(c2.items()), key=lambda x: -x[1])



if c1_items[0][0] == c2_items[0][0]:

    if len(c1_items) == 1 and len(c2_items) == 1:

        ans = n // 2

    elif len(c1_items) == 1:

        ans = n - c1_items[0][1] - c2_items[1][1]

    elif len(c2_items) == 1:

        ans = n - c1_items[0][1] - c2_items[1][1]

    else:

        v1 = n - c1_items[0][1] - c2_items[1][1]

        v2 = n - c1_items[1][1] - c2_items[0][1]

        ans = min(v1, v2)

else:

    ans = n - c1_items[0][1] - c2_items[0][1]

print(ans)

from collections import Counter

n = int(eval(input()))
V = list(map(int, input().split()))
c1 = Counter(V[::2])
c2 = Counter(V[1::2])
# print('c1, c2', c1, c2)
c1_items = sorted(list(c1.items()), key=lambda x: -x[1])
c2_items = sorted(list(c2.items()), key=lambda x: -x[1])
c1_max = c1_items[0][1]
c2_max = c2_items[0][1]
c1_second = 0
c2_second = 0
c1_max_group = set()
for key, value in c1_items:
    if value == c1_max:
        c1_max_group.add(key)
    else:
        c1_second = value
        break
c2_max_group = set()
for key, value in c2_items:
    if value == c2_max:
        c2_max_group.add(key)
    else:
        c2_second = value
        break
# print(c1_max_group, c1_max, c1_second)
# print(c2_max_group, c2_max, c2_second)
if (
    len(c1_max_group) == 1
    and len(c2_max_group) == 1
    and list(c1_max_group)[0] in c2_max_group
):
    v1 = n - c1_max - c2_second
    v2 = n - c1_second - c2_max
    ans = min(v1, v2)
else:
    ans = n - c1_max - c2_max
print(ans)

from collections import Counter

n = int(eval(input()))
V = list(map(int, input().split()))
c1 = Counter(V[::2])
c2 = Counter(V[1::2])
c1_items = sorted(list(c1.items()), key=lambda x: -x[1])
c2_items = sorted(list(c2.items()), key=lambda x: -x[1])
if c1_items[0][0] == c2_items[0][0]:
    if len(c1_items) == 1 and len(c2_items) == 1:
        ans = n // 2
    elif len(c1_items) == 1:
        ans = n - c1_items[0][1] - c2_items[1][1]
    elif len(c2_items) == 1:
        ans = n - c1_items[0][1] - c2_items[1][1]
    else:
        v1 = n - c1_items[0][1] - c2_items[1][1]
        v2 = n - c1_items[1][1] - c2_items[0][1]
        ans = min(v1, v2)
else:
    ans = n - c1_items[0][1] - c2_items[0][1]
print(ans)

-# print('c1, c2', c1, c2) -c1_max = c1_items[0][1] -c2_max = c2_items[0][1] -c1_second = 0 -c2_second = 0 -c1_max_group = set() -for key, value in c1_items: -    if value == c1_max: -        c1_max_group.add(key) +if c1_items[0][0] == c2_items[0][0]: +    if len(c1_items) == 1 and len(c2_items) == 1: +        ans = n // 2 +    elif len(c1_items) == 1: +        ans = n - c1_items[0][1] - c2_items[1][1] +    elif len(c2_items) == 1: +        ans = n - c1_items[0][1] - c2_items[1][1] -        c1_second = value -        break -c2_max_group = set() -for key, value in c2_items: -    if value == c2_max: -        c2_max_group.add(key) -    else: -        c2_second = value -        break -# print(c1_max_group, c1_max, c1_second) -# print(c2_max_group, c2_max, c2_second) -if ( -    len(c1_max_group) == 1 -    and len(c2_max_group) == 1 -    and list(c1_max_group)[0] in c2_max_group -): -    v1 = n - c1_max - c2_second -    v2 = n - c1_second - c2_max -    ans = min(v1, v2) +        v1 = n - c1_items[0][1] - c2_items[1][1] +        v2 = n - c1_items[1][1] - c2_items[0][1] +        ans = min(v1, v2) -    ans = n - c1_max - c2_max +    ans = n - c1_items[0][1] - c2_items[0][1]