# ABC111C - /\/\/\/

from collections import Counter





def main():

    N, *V = list(map(int, open(0).read().split()))

    even, odd = Counter(V[::2]).most_common(2), Counter(V[1::2]).most_common(2)

    if even[0][0] != odd[0][0]:  # replace except the modes of both parities

        ans = N - even[0][1] - odd[0][1]

    else:

        if len(even) == 1 or len(odd) == 1:

            ans = N // 2  #  replace half of the sequence

        else:  # replace smaller pair of even no.1 & odd 2 / even 2 & odd 1

            ans = N - max(even[0][1] + odd[1][1], even[1][1] + odd[0][1])

    print(ans)





if __name__ == "__main__":

    main()
# ABC111C - /\/\/\/

from collections import Counter





def main():

    N, *V = open(0).read().split()

    N = int(N)

    even, odd = Counter(V[::2]).most_common(2), Counter(V[1::2]).most_common(2)

    if even[0][0] != odd[0][0]:  # replace except the modes of both parities

        ans = N - even[0][1] - odd[0][1]

    else:

        if len(even) == 1 or len(odd) == 1:

            ans = N // 2  #  replace half of the sequence

        else:  # replace smaller pair of even no.1 & odd 2 / even 2 & odd 1

            ans = N - max(even[0][1] + odd[1][1], even[1][1] + odd[0][1])

    print(ans)





if __name__ == "__main__":

    main()
# ABC111C - /\/\/\/
from collections import Counter


def main():
    N, *V = list(map(int, open(0).read().split()))
    even, odd = Counter(V[::2]).most_common(2), Counter(V[1::2]).most_common(2)
    if even[0][0] != odd[0][0]:  # replace except the modes of both parities
        ans = N - even[0][1] - odd[0][1]
    else:
        if len(even) == 1 or len(odd) == 1:
            ans = N // 2  #  replace half of the sequence
        else:  # replace smaller pair of even no.1 & odd 2 / even 2 & odd 1
            ans = N - max(even[0][1] + odd[1][1], even[1][1] + odd[0][1])
    print(ans)


if __name__ == "__main__":
    main()

# ABC111C - /\/\/\/
from collections import Counter


def main():
    N, *V = open(0).read().split()
    N = int(N)
    even, odd = Counter(V[::2]).most_common(2), Counter(V[1::2]).most_common(2)
    if even[0][0] != odd[0][0]:  # replace except the modes of both parities
        ans = N - even[0][1] - odd[0][1]
    else:
        if len(even) == 1 or len(odd) == 1:
            ans = N // 2  #  replace half of the sequence
        else:  # replace smaller pair of even no.1 & odd 2 / even 2 & odd 1
            ans = N - max(even[0][1] + odd[1][1], even[1][1] + odd[0][1])
    print(ans)


if __name__ == "__main__":
    main()

-    N, *V = list(map(int, open(0).read().split())) +    N, *V = open(0).read().split() +    N = int(N)