# -*- coding: utf-8 -*-

from collections import defaultdict

from operator import itemgetter

def solve():

    n = int(eval(input()))

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

    l = defaultdict(int)

    u = defaultdict(int)

    for i in range(0,n,2):

        l[V[i]] += 1

        u[V[i+1]] += 1



    l = sorted(list(l.items()),key=itemgetter(1))[::-1]

    u = sorted(list(u.items()),key=itemgetter(1))[::-1]

    if len(l) == len(u) == 1:

        if l[0][0] != u[0][0]:

            res = 0

        else:

            res = min(l[0][1], u[0][1])

    else:

        if l[0][0] != u[0][0]:

            res = sum(map(itemgetter(1), l[1:])) + sum(map(itemgetter(1), u[1:]))

        elif len(u) == 1 or (len(l) > 1 and l[1][1]+u[0][1] > l[0][1]+u[1][1]):

            res = l[0][1] + sum(map(itemgetter(1), l[2:])) + sum(map(itemgetter(1), u[1:]))

        else:

            res = u[0][1] + sum(map(itemgetter(1), l[1:])) + sum(map(itemgetter(1), u[2:]))



    return str(res)



if __name__ == '__main__':

    print((solve()))



# -*- coding: utf-8 -*-

from collections import Counter

from operator import itemgetter

def solve():

    eval(input())

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

    l = sorted(list(Counter(V[::2]).items())+[(0,0)], key=itemgetter(1), reverse=True)

    u = sorted(list(Counter(V[1::2]).items())+[(0,0)], key=itemgetter(1), reverse=True)

    res = sum(map(itemgetter(1), l+u)) - (max(l[0][1]+u[1][1], l[1][1]+u[0][1]) if l[0][0]==u[0][0] else (l[0][1]+u[0][1]))

    return str(res)



if __name__ == '__main__':

    print((solve()))



# -*- coding: utf-8 -*-
from collections import defaultdict
from operator import itemgetter


def solve():
    n = int(eval(input()))
    V = list(map(int, input().split()))
    l = defaultdict(int)
    u = defaultdict(int)
    for i in range(0, n, 2):
        l[V[i]] += 1
        u[V[i + 1]] += 1
    l = sorted(list(l.items()), key=itemgetter(1))[::-1]
    u = sorted(list(u.items()), key=itemgetter(1))[::-1]
    if len(l) == len(u) == 1:
        if l[0][0] != u[0][0]:
            res = 0
        else:
            res = min(l[0][1], u[0][1])
    else:
        if l[0][0] != u[0][0]:
            res = sum(map(itemgetter(1), l[1:])) + sum(map(itemgetter(1), u[1:]))
        elif len(u) == 1 or (len(l) > 1 and l[1][1] + u[0][1] > l[0][1] + u[1][1]):
            res = (
                l[0][1]
                + sum(map(itemgetter(1), l[2:]))
                + sum(map(itemgetter(1), u[1:]))
            )
        else:
            res = (
                u[0][1]
                + sum(map(itemgetter(1), l[1:]))
                + sum(map(itemgetter(1), u[2:]))
            )
    return str(res)


if __name__ == "__main__":
    print((solve()))

# -*- coding: utf-8 -*-
from collections import Counter
from operator import itemgetter


def solve():
    eval(input())
    V = list(map(int, input().split()))
    l = sorted(
        list(Counter(V[::2]).items()) + [(0, 0)], key=itemgetter(1), reverse=True
    )
    u = sorted(
        list(Counter(V[1::2]).items()) + [(0, 0)], key=itemgetter(1), reverse=True
    )
    res = sum(map(itemgetter(1), l + u)) - (
        max(l[0][1] + u[1][1], l[1][1] + u[0][1])
        if l[0][0] == u[0][0]
        else (l[0][1] + u[0][1])
    )
    return str(res)


if __name__ == "__main__":
    print((solve()))

-from collections import defaultdict +from collections import Counter -    n = int(eval(input())) +    eval(input()) -    l = defaultdict(int) -    u = defaultdict(int) -    for i in range(0, n, 2): -        l[V[i]] += 1 -        u[V[i + 1]] += 1 -    l = sorted(list(l.items()), key=itemgetter(1))[::-1] -    u = sorted(list(u.items()), key=itemgetter(1))[::-1] -    if len(l) == len(u) == 1: -        if l[0][0] != u[0][0]: -            res = 0 -        else: -            res = min(l[0][1], u[0][1]) -    else: -        if l[0][0] != u[0][0]: -            res = sum(map(itemgetter(1), l[1:])) + sum(map(itemgetter(1), u[1:])) -        elif len(u) == 1 or (len(l) > 1 and l[1][1] + u[0][1] > l[0][1] + u[1][1]): -            res = ( -                l[0][1] -                + sum(map(itemgetter(1), l[2:])) -                + sum(map(itemgetter(1), u[1:])) -            ) -        else: -            res = ( -                u[0][1] -                + sum(map(itemgetter(1), l[1:])) -                + sum(map(itemgetter(1), u[2:])) -            ) +    l = sorted( +        list(Counter(V[::2]).items()) + [(0, 0)], key=itemgetter(1), reverse=True +    ) +    u = sorted( +        list(Counter(V[1::2]).items()) + [(0, 0)], key=itemgetter(1), reverse=True +    ) +    res = sum(map(itemgetter(1), l + u)) - ( +        max(l[0][1] + u[1][1], l[1][1] + u[0][1]) +        if l[0][0] == u[0][0] +        else (l[0][1] + u[0][1]) +    )