#!/usr/bin/env python3

import sys





def solve(n: int, v: "List[int]"):

    from collections import Counter

    a = sorted(list(Counter(v[::2]).items()), key=lambda x: (x[1], x[0]))

    b = sorted(list(Counter(v[1::2]).items()), key=lambda x: (x[1], x[0]))

    if a[-1][0] != b[-1][0]:

        return n - a[-1][1] - b[-1][1]

    a = [(0, 0)] + a

    b = [(0, 0)] + b

    return n - max(a[-1][1] + b[-2][1],

                   a[-2][1] + b[-1][1])





# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools

def main():

    def iterate_tokens():

        for line in sys.stdin:

            for word in line.split():

                yield word

    tokens = iterate_tokens()

    n = int(next(tokens))  # type: int

    v = [int(next(tokens)) for _ in range(n)]  # type: "List[int]"

    print((solve(n, v)))



def test():

    import doctest

    doctest.testmod()



if __name__ == '__main__':

    #test()

    main()

#!/usr/bin/env python3

import sys





def solve(n: int, v: "List[int]"):

    from collections import Counter

    a = Counter(v[::2]).most_common()

    b = Counter(v[1::2]).most_common()

    if a[0][0] != b[0][0]:

        return n - a[0][1] - b[0][1]

    a = a + [(0, 0)]

    b = b + [(0, 0)]

    return n - max(a[0][1] + b[1][1],

                   a[1][1] + b[0][1])





# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools

def main():

    def iterate_tokens():

        for line in sys.stdin:

            for word in line.split():

                yield word

    tokens = iterate_tokens()

    n = int(next(tokens))  # type: int

    v = [int(next(tokens)) for _ in range(n)]  # type: "List[int]"

    print((solve(n, v)))



def test():

    import doctest

    doctest.testmod()



if __name__ == '__main__':

    #test()

    main()

#!/usr/bin/env python3
import sys


def solve(n: int, v: "List[int]"):
    from collections import Counter

    a = sorted(list(Counter(v[::2]).items()), key=lambda x: (x[1], x[0]))
    b = sorted(list(Counter(v[1::2]).items()), key=lambda x: (x[1], x[0]))
    if a[-1][0] != b[-1][0]:
        return n - a[-1][1] - b[-1][1]
    a = [(0, 0)] + a
    b = [(0, 0)] + b
    return n - max(a[-1][1] + b[-2][1], a[-2][1] + b[-1][1])


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word

    tokens = iterate_tokens()
    n = int(next(tokens))  # type: int
    v = [int(next(tokens)) for _ in range(n)]  # type: "List[int]"
    print((solve(n, v)))


def test():
    import doctest

    doctest.testmod()


if __name__ == "__main__":
    # test()
    main()

#!/usr/bin/env python3
import sys


def solve(n: int, v: "List[int]"):
    from collections import Counter

    a = Counter(v[::2]).most_common()
    b = Counter(v[1::2]).most_common()
    if a[0][0] != b[0][0]:
        return n - a[0][1] - b[0][1]
    a = a + [(0, 0)]
    b = b + [(0, 0)]
    return n - max(a[0][1] + b[1][1], a[1][1] + b[0][1])


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word

    tokens = iterate_tokens()
    n = int(next(tokens))  # type: int
    v = [int(next(tokens)) for _ in range(n)]  # type: "List[int]"
    print((solve(n, v)))


def test():
    import doctest

    doctest.testmod()


if __name__ == "__main__":
    # test()
    main()

-    a = sorted(list(Counter(v[::2]).items()), key=lambda x: (x[1], x[0])) -    b = sorted(list(Counter(v[1::2]).items()), key=lambda x: (x[1], x[0])) -    if a[-1][0] != b[-1][0]: -        return n - a[-1][1] - b[-1][1] -    a = [(0, 0)] + a -    b = [(0, 0)] + b -    return n - max(a[-1][1] + b[-2][1], a[-2][1] + b[-1][1]) +    a = Counter(v[::2]).most_common() +    b = Counter(v[1::2]).most_common() +    if a[0][0] != b[0][0]: +        return n - a[0][1] - b[0][1] +    a = a + [(0, 0)] +    b = b + [(0, 0)] +    return n - max(a[0][1] + b[1][1], a[1][1] + b[0][1])