from collections import Counter



n = int(eval(input()))

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

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

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

a.append([0,0])

b.append([0,0])

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

    print((n-(a[0][1]+b[0][1])))

else:

    print((min(n-(a[1][1]+b[0][1]),n-(a[0][1]+b[1][1]))))


from collections import Counter





def resolve():

    N = int(eval(input()))

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



    O = Counter(A[::2])

    E = Counter(A[1::2])



    most_O = O.most_common(2)

    most_E = E.most_common(2)

    # 番兵

    most_O.append((0, 0))

    most_E.append((0, 0))



    cnt = 0

    # key comp

    if most_O[0][0] == most_E[0][0]:

        # value

        res1 = most_O[0][1] + most_E[1][1]

        res2 = most_O[1][1] + most_E[0][1]

        cnt = max(res1, res2)

    else:

        cnt = most_O[0][1] + most_E[0][1]



    # 数字が少ないものを書き換える為、Nで引く

    print((N - cnt))





if __name__ == "__main__":

    resolve()

from collections import Counter

n = int(eval(input()))
v = list(map(int, input().split()))
a = Counter(v[0::2]).most_common()
b = Counter(v[1::2]).most_common()
a.append([0, 0])
b.append([0, 0])
if a[0][0] != b[0][0]:
    print((n - (a[0][1] + b[0][1])))
else:
    print((min(n - (a[1][1] + b[0][1]), n - (a[0][1] + b[1][1]))))

from collections import Counter


def resolve():
    N = int(eval(input()))
    A = list(map(int, input().split()))
    O = Counter(A[::2])
    E = Counter(A[1::2])
    most_O = O.most_common(2)
    most_E = E.most_common(2)
    # 番兵
    most_O.append((0, 0))
    most_E.append((0, 0))
    cnt = 0
    # key comp
    if most_O[0][0] == most_E[0][0]:
        # value
        res1 = most_O[0][1] + most_E[1][1]
        res2 = most_O[1][1] + most_E[0][1]
        cnt = max(res1, res2)
    else:
        cnt = most_O[0][1] + most_E[0][1]
    # 数字が少ないものを書き換える為、Nで引く
    print((N - cnt))


if __name__ == "__main__":
    resolve()

-n = int(eval(input())) -v = list(map(int, input().split())) -a = Counter(v[0::2]).most_common() -b = Counter(v[1::2]).most_common() -a.append([0, 0]) -b.append([0, 0]) -if a[0][0] != b[0][0]: -    print((n - (a[0][1] + b[0][1]))) -else: -    print((min(n - (a[1][1] + b[0][1]), n - (a[0][1] + b[1][1])))) + +def resolve(): +    N = int(eval(input())) +    A = list(map(int, input().split())) +    O = Counter(A[::2]) +    E = Counter(A[1::2]) +    most_O = O.most_common(2) +    most_E = E.most_common(2) +    # 番兵 +    most_O.append((0, 0)) +    most_E.append((0, 0)) +    cnt = 0 +    # key comp +    if most_O[0][0] == most_E[0][0]: +        # value +        res1 = most_O[0][1] + most_E[1][1] +        res2 = most_O[1][1] + most_E[0][1] +        cnt = max(res1, res2) +    else: +        cnt = most_O[0][1] + most_E[0][1] +    # 数字が少ないものを書き換える為、Nで引く +    print((N - cnt)) + + +if __name__ == "__main__": +    resolve()