import collections

def main():

    n = int(eval(input()))

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



    if len(set(v)) == 1:

        print((n//2))

    elif len(set(v)) == 2:

        cnt1 = 0

        cnt2 = 0

        tmp1 = list(set(v))

        tmp2 = [tmp1[1], tmp1[0]]

        # even = v[::2]

        # odd = v[1::2]

        #

        for i, a in enumerate(v):

            if i % 2 == 0:

                if a == tmp1[0]:

                    cnt1 += 1

                if a == tmp2[0]:

                    cnt2 += 1

            else :

                if a == tmp1[1]:

                    cnt1 += 1

                if a == tmp2[1]:

                    cnt2 += 1

        print((n-max(cnt1,cnt2)))

    else:

        even = v[::2]

        odd = v[1::2]

        count_e = collections.Counter(even)

        count_o = collections.Counter(odd)

        ce = count_e.most_common()

        co = count_o.most_common()

        if ce[0][0] != co[0][0]:

            print((n-ce[0][1] - co[0][1]))

        else:

            if len(ce) == 1:

                print((n-co[1][1]))

            elif len(co) == 1:

                print((n-ce[1][1]))

            else:

                print((min(n-ce[0][1]-co[1][1], n-ce[1][1]-co[0][1])))









if __name__ == '__main__':

    main()

import collections

def main():

    n = int(eval(input()))

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



    even = v[::2]

    odd = v[1::2]

    count_e = collections.Counter(even)

    count_o = collections.Counter(odd)

    ce = count_e.most_common()

    co = count_o.most_common()

    if ce[0][0] != co[0][0]:

        print((n-ce[0][1] - co[0][1]))

    else:

        if len(ce) == 1 and len(co) == 1:

            print((n//2))

        elif len(ce) == 1:

            print((n-co[1][1]))

        elif len(co) == 1:

            print((n-ce[1][1]))

        else:

            print((min(n-ce[0][1]-co[1][1], n-ce[1][1]-co[0][1])))









if __name__ == '__main__':

    main()

import collections


def main():
    n = int(eval(input()))
    v = list(map(int, input().split()))
    if len(set(v)) == 1:
        print((n // 2))
    elif len(set(v)) == 2:
        cnt1 = 0
        cnt2 = 0
        tmp1 = list(set(v))
        tmp2 = [tmp1[1], tmp1[0]]
        # even = v[::2]
        # odd = v[1::2]
        #
        for i, a in enumerate(v):
            if i % 2 == 0:
                if a == tmp1[0]:
                    cnt1 += 1
                if a == tmp2[0]:
                    cnt2 += 1
            else:
                if a == tmp1[1]:
                    cnt1 += 1
                if a == tmp2[1]:
                    cnt2 += 1
        print((n - max(cnt1, cnt2)))
    else:
        even = v[::2]
        odd = v[1::2]
        count_e = collections.Counter(even)
        count_o = collections.Counter(odd)
        ce = count_e.most_common()
        co = count_o.most_common()
        if ce[0][0] != co[0][0]:
            print((n - ce[0][1] - co[0][1]))
        else:
            if len(ce) == 1:
                print((n - co[1][1]))
            elif len(co) == 1:
                print((n - ce[1][1]))
            else:
                print((min(n - ce[0][1] - co[1][1], n - ce[1][1] - co[0][1])))


if __name__ == "__main__":
    main()

import collections


def main():
    n = int(eval(input()))
    v = list(map(int, input().split()))
    even = v[::2]
    odd = v[1::2]
    count_e = collections.Counter(even)
    count_o = collections.Counter(odd)
    ce = count_e.most_common()
    co = count_o.most_common()
    if ce[0][0] != co[0][0]:
        print((n - ce[0][1] - co[0][1]))
    else:
        if len(ce) == 1 and len(co) == 1:
            print((n // 2))
        elif len(ce) == 1:
            print((n - co[1][1]))
        elif len(co) == 1:
            print((n - ce[1][1]))
        else:
            print((min(n - ce[0][1] - co[1][1], n - ce[1][1] - co[0][1])))


if __name__ == "__main__":
    main()

-    if len(set(v)) == 1: -        print((n // 2)) -    elif len(set(v)) == 2: -        cnt1 = 0 -        cnt2 = 0 -        tmp1 = list(set(v)) -        tmp2 = [tmp1[1], tmp1[0]] -        # even = v[::2] -        # odd = v[1::2] -        # -        for i, a in enumerate(v): -            if i % 2 == 0: -                if a == tmp1[0]: -                    cnt1 += 1 -                if a == tmp2[0]: -                    cnt2 += 1 -            else: -                if a == tmp1[1]: -                    cnt1 += 1 -                if a == tmp2[1]: -                    cnt2 += 1 -        print((n - max(cnt1, cnt2))) +    even = v[::2] +    odd = v[1::2] +    count_e = collections.Counter(even) +    count_o = collections.Counter(odd) +    ce = count_e.most_common() +    co = count_o.most_common() +    if ce[0][0] != co[0][0]: +        print((n - ce[0][1] - co[0][1])) -        even = v[::2] -        odd = v[1::2] -        count_e = collections.Counter(even) -        count_o = collections.Counter(odd) -        ce = count_e.most_common() -        co = count_o.most_common() -        if ce[0][0] != co[0][0]: -            print((n - ce[0][1] - co[0][1])) +        if len(ce) == 1 and len(co) == 1: +            print((n // 2)) +        elif len(ce) == 1: +            print((n - co[1][1])) +        elif len(co) == 1: +            print((n - ce[1][1])) -            if len(ce) == 1: -                print((n - co[1][1])) -            elif len(co) == 1: -                print((n - ce[1][1])) -            else: -                print((min(n - ce[0][1] - co[1][1], n - ce[1][1] - co[0][1]))) +            print((min(n - ce[0][1] - co[1][1], n - ce[1][1] - co[0][1])))