N = int(eval(input()))

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



odd = {}

even = {}

for i in range(N):

    if i%2==0:

        if V[i] in even:

            even[V[i]] += 1

        else:

            even[V[i]] = 1

    else:

        if V[i] in odd:

            odd[V[i]] += 1

        else:

            odd[V[i]] = 1

maxEven, maxOdd = max(even.values()), max(odd.values())

if max(even, key=even.get) != max(odd, key=odd.get):

    print((N-maxEven-maxOdd))

else:

    even[max(even, key=even.get)] = 0

    odd[max(odd, key=odd.get)] = 0

    maxEven2, maxOdd2 = max(even.values()), max(odd.values())

    if maxEven2 >= maxOdd2:

        if len(even) > 1:

            print((N-maxEven2-maxOdd))

        else:

            print((N-maxOdd))

    else:

        if len(odd) > 1:

            print((N-maxEven-maxOdd2))

        else:

            print((N-maxEven))

import sys



def solve():

    input = sys.stdin.readline

    N = int(eval(input()))

    H = N // 2

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

    odd, even = dict(), dict()

    for i, v in enumerate(V):

        if i % 2 == 0:

            if v in even: even[v] += 1

            else: even[v] = 1

        else:

            if v in odd: odd[v] += 1

            else: odd[v] = 1



    evenL = [(0, 0), (0, 0)]

    evenMax = 0

    for key in even:

        if even[key] >= evenL[0][0]: evenL = [(even[key], key), evenL[0]]

        elif even[key] >= evenL[1][0]: evenL[1] = (even[key], key)

    oddL = [(0, 0), (0, 0)]

    for key in odd:

        if odd[key] >= oddL[0][0]: oddL = [(odd[key], key), oddL[0]]

        elif odd[key] >= oddL[1][0]: oddL[1] = (odd[key], key)





    if evenL[0][1] == oddL[0][1]: print((N - max(evenL[0][0] + oddL[1][0], evenL[1][0] + oddL[0][0])))

    else: print((N - evenL[0][0] - oddL[0][0]))



    return 0



if __name__ == "__main__":

    solve()
N = int(eval(input()))
V = [int(_) for _ in input().split()]
odd = {}
even = {}
for i in range(N):
    if i % 2 == 0:
        if V[i] in even:
            even[V[i]] += 1
        else:
            even[V[i]] = 1
    else:
        if V[i] in odd:
            odd[V[i]] += 1
        else:
            odd[V[i]] = 1
maxEven, maxOdd = max(even.values()), max(odd.values())
if max(even, key=even.get) != max(odd, key=odd.get):
    print((N - maxEven - maxOdd))
else:
    even[max(even, key=even.get)] = 0
    odd[max(odd, key=odd.get)] = 0
    maxEven2, maxOdd2 = max(even.values()), max(odd.values())
    if maxEven2 >= maxOdd2:
        if len(even) > 1:
            print((N - maxEven2 - maxOdd))
        else:
            print((N - maxOdd))
    else:
        if len(odd) > 1:
            print((N - maxEven - maxOdd2))
        else:
            print((N - maxEven))

import sys


def solve():
    input = sys.stdin.readline
    N = int(eval(input()))
    H = N // 2
    V = [int(v) for v in input().split()]
    odd, even = dict(), dict()
    for i, v in enumerate(V):
        if i % 2 == 0:
            if v in even:
                even[v] += 1
            else:
                even[v] = 1
        else:
            if v in odd:
                odd[v] += 1
            else:
                odd[v] = 1
    evenL = [(0, 0), (0, 0)]
    evenMax = 0
    for key in even:
        if even[key] >= evenL[0][0]:
            evenL = [(even[key], key), evenL[0]]
        elif even[key] >= evenL[1][0]:
            evenL[1] = (even[key], key)
    oddL = [(0, 0), (0, 0)]
    for key in odd:
        if odd[key] >= oddL[0][0]:
            oddL = [(odd[key], key), oddL[0]]
        elif odd[key] >= oddL[1][0]:
            oddL[1] = (odd[key], key)
    if evenL[0][1] == oddL[0][1]:
        print((N - max(evenL[0][0] + oddL[1][0], evenL[1][0] + oddL[0][0])))
    else:
        print((N - evenL[0][0] - oddL[0][0]))
    return 0


if __name__ == "__main__":
    solve()

-N = int(eval(input())) -V = [int(_) for _ in input().split()] -odd = {} -even = {} -for i in range(N): -    if i % 2 == 0: -        if V[i] in even: -            even[V[i]] += 1 +import sys + + +def solve(): +    input = sys.stdin.readline +    N = int(eval(input())) +    H = N // 2 +    V = [int(v) for v in input().split()] +    odd, even = dict(), dict() +    for i, v in enumerate(V): +        if i % 2 == 0: +            if v in even: +                even[v] += 1 +            else: +                even[v] = 1 -            even[V[i]] = 1 +            if v in odd: +                odd[v] += 1 +            else: +                odd[v] = 1 +    evenL = [(0, 0), (0, 0)] +    evenMax = 0 +    for key in even: +        if even[key] >= evenL[0][0]: +            evenL = [(even[key], key), evenL[0]] +        elif even[key] >= evenL[1][0]: +            evenL[1] = (even[key], key) +    oddL = [(0, 0), (0, 0)] +    for key in odd: +        if odd[key] >= oddL[0][0]: +            oddL = [(odd[key], key), oddL[0]] +        elif odd[key] >= oddL[1][0]: +            oddL[1] = (odd[key], key) +    if evenL[0][1] == oddL[0][1]: +        print((N - max(evenL[0][0] + oddL[1][0], evenL[1][0] + oddL[0][0]))) -        if V[i] in odd: -            odd[V[i]] += 1 -        else: -            odd[V[i]] = 1 -maxEven, maxOdd = max(even.values()), max(odd.values()) -if max(even, key=even.get) != max(odd, key=odd.get): -    print((N - maxEven - maxOdd)) -else: -    even[max(even, key=even.get)] = 0 -    odd[max(odd, key=odd.get)] = 0 -    maxEven2, maxOdd2 = max(even.values()), max(odd.values()) -    if maxEven2 >= maxOdd2: -        if len(even) > 1: -            print((N - maxEven2 - maxOdd)) -        else: -            print((N - maxOdd)) -    else: -        if len(odd) > 1: -            print((N - maxEven - maxOdd2)) -        else: -            print((N - maxEven)) +        print((N - evenL[0][0] - oddL[0][0])) +    return 0 + + +if __name__ == "__main__": +    solve()