import sys

input = sys.stdin.readline

from collections import Counter







def main():

    N = int(eval(input()))

    V = [int(x) for x in input().split()]



    a = []

    b = []

    for i in range(N):

        if i & 1:

            a.append(V[i])

        else:

            b.append(V[i])



    ac = Counter(a)

    bc = Counter(b)



    acm = ac.most_common()

    bcm = bc.most_common()



    if acm[0][0] != bcm[0][0]:

        print((N // 2 - acm[0][1] + N // 2 - bcm[0][1]))

    else:

        ans = float("inf")

        for i in acm:

            if i[0] == bcm[0][0]:

                continue

            ans = min(ans, N // 2 - i[1] + N // 2 - bcm[0][1])



        for j in bcm:

            if acm[0][0] == j[0]:

                continue

            ans = min(ans, N // 2 - j[1] + N // 2 - acm[0][1])

        if ans == float("inf"):

            print((N // 2))

        else:

            print(ans)





if __name__ == '__main__':

    main()



import sys

input = sys.stdin.readline

from collections import Counter







def main():

    N = int(eval(input()))

    V = [int(x) for x in input().split()]



    ac = Counter()

    bc = Counter()

    for i in range(N):

        if i & 1:

            ac[V[i]] += 1

        else:

            bc[V[i]] += 1



    acm = ac.most_common()

    bcm = bc.most_common()



    if acm[0][0] != bcm[0][0]:

        print((N // 2 - acm[0][1] + N // 2 - bcm[0][1]))

    else:

        ans = float("inf")

        for i in acm:

            if i[0] == bcm[0][0]:

                continue

            ans = min(ans, N // 2 - i[1] + N // 2 - bcm[0][1])



        for j in bcm:

            if acm[0][0] == j[0]:

                continue

            ans = min(ans, N // 2 - j[1] + N // 2 - acm[0][1])

        if ans == float("inf"):

            print((N // 2))

        else:

            print(ans)





if __name__ == '__main__':

    main()



import sys

input = sys.stdin.readline
from collections import Counter


def main():
    N = int(eval(input()))
    V = [int(x) for x in input().split()]
    a = []
    b = []
    for i in range(N):
        if i & 1:
            a.append(V[i])
        else:
            b.append(V[i])
    ac = Counter(a)
    bc = Counter(b)
    acm = ac.most_common()
    bcm = bc.most_common()
    if acm[0][0] != bcm[0][0]:
        print((N // 2 - acm[0][1] + N // 2 - bcm[0][1]))
    else:
        ans = float("inf")
        for i in acm:
            if i[0] == bcm[0][0]:
                continue
            ans = min(ans, N // 2 - i[1] + N // 2 - bcm[0][1])
        for j in bcm:
            if acm[0][0] == j[0]:
                continue
            ans = min(ans, N // 2 - j[1] + N // 2 - acm[0][1])
        if ans == float("inf"):
            print((N // 2))
        else:
            print(ans)


if __name__ == "__main__":
    main()

import sys

input = sys.stdin.readline
from collections import Counter


def main():
    N = int(eval(input()))
    V = [int(x) for x in input().split()]
    ac = Counter()
    bc = Counter()
    for i in range(N):
        if i & 1:
            ac[V[i]] += 1
        else:
            bc[V[i]] += 1
    acm = ac.most_common()
    bcm = bc.most_common()
    if acm[0][0] != bcm[0][0]:
        print((N // 2 - acm[0][1] + N // 2 - bcm[0][1]))
    else:
        ans = float("inf")
        for i in acm:
            if i[0] == bcm[0][0]:
                continue
            ans = min(ans, N // 2 - i[1] + N // 2 - bcm[0][1])
        for j in bcm:
            if acm[0][0] == j[0]:
                continue
            ans = min(ans, N // 2 - j[1] + N // 2 - acm[0][1])
        if ans == float("inf"):
            print((N // 2))
        else:
            print(ans)


if __name__ == "__main__":
    main()

-    a = [] -    b = [] +    ac = Counter() +    bc = Counter() -            a.append(V[i]) +            ac[V[i]] += 1 -            b.append(V[i]) -    ac = Counter(a) -    bc = Counter(b) +            bc[V[i]] += 1