import collections

 

n = int(eval(input()))

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

a = v[::2]

b = v[1::2]

ac = collections.Counter(a).most_common(2)

bc = collections.Counter(b).most_common(2)

if ac[0][0] != bc[0][0]:

    print((n - ac[0][1] - bc[0][1]))

else:

    if len(ac) == 1:

        print((n // 2))

    else:

        print((n - max(ac[0][1] + bc[1][1], ac[1][1] + bc[0][1])))
from collections import Counter





def solve(V):

    n = len(V)

    ac = Counter(V[::2]).most_common(2)

    bc = Counter(V[1::2]).most_common(2)



    if ac[0][0] != bc[0][0]:

        return n - ac[0][1] - bc[0][1]

    else:

        if len(bc) == 1 or len(ac) == 1:

            return n // 2

        else:

            return n - max(ac[0][1] + bc[1][1], ac[1][1] + bc[0][1])





if __name__ == "__main__":

    n = int(eval(input()))

    l = eval(input())

    print((solve(l.split(" "))))

import collections

n = int(eval(input()))
v = list(map(int, input().split()))
a = v[::2]
b = v[1::2]
ac = collections.Counter(a).most_common(2)
bc = collections.Counter(b).most_common(2)
if ac[0][0] != bc[0][0]:
    print((n - ac[0][1] - bc[0][1]))
else:
    if len(ac) == 1:
        print((n // 2))
    else:
        print((n - max(ac[0][1] + bc[1][1], ac[1][1] + bc[0][1])))

from collections import Counter


def solve(V):
    n = len(V)
    ac = Counter(V[::2]).most_common(2)
    bc = Counter(V[1::2]).most_common(2)
    if ac[0][0] != bc[0][0]:
        return n - ac[0][1] - bc[0][1]
    else:
        if len(bc) == 1 or len(ac) == 1:
            return n // 2
        else:
            return n - max(ac[0][1] + bc[1][1], ac[1][1] + bc[0][1])


if __name__ == "__main__":
    n = int(eval(input()))
    l = eval(input())
    print((solve(l.split(" "))))

-import collections +from collections import Counter -n = int(eval(input())) -v = list(map(int, input().split())) -a = v[::2] -b = v[1::2] -ac = collections.Counter(a).most_common(2) -bc = collections.Counter(b).most_common(2) -if ac[0][0] != bc[0][0]: -    print((n - ac[0][1] - bc[0][1])) -else: -    if len(ac) == 1: -        print((n // 2)) + +def solve(V): +    n = len(V) +    ac = Counter(V[::2]).most_common(2) +    bc = Counter(V[1::2]).most_common(2) +    if ac[0][0] != bc[0][0]: +        return n - ac[0][1] - bc[0][1] -        print((n - max(ac[0][1] + bc[1][1], ac[1][1] + bc[0][1]))) +        if len(bc) == 1 or len(ac) == 1: +            return n // 2 +        else: +            return n - max(ac[0][1] + bc[1][1], ac[1][1] + bc[0][1]) + + +if __name__ == "__main__": +    n = int(eval(input())) +    l = eval(input()) +    print((solve(l.split(" "))))