from collections import Counter

from collections import deque



if __name__ == '__main__':

    n = int(eval(input()))

    vs0 = []

    vs1 = []

    for i,v in enumerate(map(int, input().split())):

        if i % 2 == 0:

            vs0.append(v)

        else:

            vs1.append(v)

    vs0 = deque(sorted(list(Counter(vs0).items()), key=lambda t: t[1]))

    vs1 = deque(sorted(list(Counter(vs1).items()), key=lambda t: t[1]))

    t0 = vs0.pop()

    t1 = vs1.pop()

    if t0[0] != t1[0]:

        vs0 = (t[1] for t in vs0)

        vs1 = (t[1] for t in vs1)

        print((sum(vs0) + sum(vs1)))

    else:

        if len(vs1) == 0:

            if len(vs0) == 0:

                print((t1[1]))

            else:

                vs0 = (t[1] for t in vs0)

                print((sum(vs0)))

        elif len(vs0) == 0:

            vs1 = (t[1] for t in vs1)

            print((sum(vs1)))

        else:

            t00 = vs0.pop()

            t11 = vs1.pop()

            a = t00[1] + t1[1]

            b = t11[1] + t0[1]

            vs0 = (t[1] for t in vs0)

            vs1 = (t[1] for t in vs1)

            print((sum(vs0) + sum(vs1) + (a if a < b else b)))





from collections import Counter



if __name__ == '__main__':

    n = int(eval(input()))

    vs = [int(s) for s in input().split()]

    counter0 = list(Counter(vs[0::2]).items()) + [(100001, 0)]

    counter1 = list(Counter(vs[1::2]).items()) + [(100001, 0)]

    v0, c0 = max(counter0, key=lambda t: t[1])

    v1, c1 = max(counter1, key=lambda t: t[1])

    counter0.remove((v0, c0))

    counter1.remove((v1, c1))

    res = 0

    if v0 != v1:

        res = n - c0 - c1

    else:

        _, c02 = max(counter0, key=lambda t: t[1])

        _, c12 = max(counter1, key=lambda t: t[1])

        res = n - (c0 + c12 if c12 > c02 else c1 + c02)

    print(res)

from collections import Counter
from collections import deque

if __name__ == "__main__":
    n = int(eval(input()))
    vs0 = []
    vs1 = []
    for i, v in enumerate(map(int, input().split())):
        if i % 2 == 0:
            vs0.append(v)
        else:
            vs1.append(v)
    vs0 = deque(sorted(list(Counter(vs0).items()), key=lambda t: t[1]))
    vs1 = deque(sorted(list(Counter(vs1).items()), key=lambda t: t[1]))
    t0 = vs0.pop()
    t1 = vs1.pop()
    if t0[0] != t1[0]:
        vs0 = (t[1] for t in vs0)
        vs1 = (t[1] for t in vs1)
        print((sum(vs0) + sum(vs1)))
    else:
        if len(vs1) == 0:
            if len(vs0) == 0:
                print((t1[1]))
            else:
                vs0 = (t[1] for t in vs0)
                print((sum(vs0)))
        elif len(vs0) == 0:
            vs1 = (t[1] for t in vs1)
            print((sum(vs1)))
        else:
            t00 = vs0.pop()
            t11 = vs1.pop()
            a = t00[1] + t1[1]
            b = t11[1] + t0[1]
            vs0 = (t[1] for t in vs0)
            vs1 = (t[1] for t in vs1)
            print((sum(vs0) + sum(vs1) + (a if a < b else b)))

from collections import Counter

if __name__ == "__main__":
    n = int(eval(input()))
    vs = [int(s) for s in input().split()]
    counter0 = list(Counter(vs[0::2]).items()) + [(100001, 0)]
    counter1 = list(Counter(vs[1::2]).items()) + [(100001, 0)]
    v0, c0 = max(counter0, key=lambda t: t[1])
    v1, c1 = max(counter1, key=lambda t: t[1])
    counter0.remove((v0, c0))
    counter1.remove((v1, c1))
    res = 0
    if v0 != v1:
        res = n - c0 - c1
    else:
        _, c02 = max(counter0, key=lambda t: t[1])
        _, c12 = max(counter1, key=lambda t: t[1])
        res = n - (c0 + c12 if c12 > c02 else c1 + c02)
    print(res)

-from collections import deque -    vs0 = [] -    vs1 = [] -    for i, v in enumerate(map(int, input().split())): -        if i % 2 == 0: -            vs0.append(v) -        else: -            vs1.append(v) -    vs0 = deque(sorted(list(Counter(vs0).items()), key=lambda t: t[1])) -    vs1 = deque(sorted(list(Counter(vs1).items()), key=lambda t: t[1])) -    t0 = vs0.pop() -    t1 = vs1.pop() -    if t0[0] != t1[0]: -        vs0 = (t[1] for t in vs0) -        vs1 = (t[1] for t in vs1) -        print((sum(vs0) + sum(vs1))) +    vs = [int(s) for s in input().split()] +    counter0 = list(Counter(vs[0::2]).items()) + [(100001, 0)] +    counter1 = list(Counter(vs[1::2]).items()) + [(100001, 0)] +    v0, c0 = max(counter0, key=lambda t: t[1]) +    v1, c1 = max(counter1, key=lambda t: t[1]) +    counter0.remove((v0, c0)) +    counter1.remove((v1, c1)) +    res = 0 +    if v0 != v1: +        res = n - c0 - c1 -        if len(vs1) == 0: -            if len(vs0) == 0: -                print((t1[1])) -            else: -                vs0 = (t[1] for t in vs0) -                print((sum(vs0))) -        elif len(vs0) == 0: -            vs1 = (t[1] for t in vs1) -            print((sum(vs1))) -        else: -            t00 = vs0.pop() -            t11 = vs1.pop() -            a = t00[1] + t1[1] -            b = t11[1] + t0[1] -            vs0 = (t[1] for t in vs0) -            vs1 = (t[1] for t in vs1) -            print((sum(vs0) + sum(vs1) + (a if a < b else b))) +        _, c02 = max(counter0, key=lambda t: t[1]) +        _, c12 = max(counter1, key=lambda t: t[1]) +        res = n - (c0 + c12 if c12 > c02 else c1 + c02) +    print(res)