from collections import Counter, OrderedDict





n = int(eval(input()))

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





if len(set(lst_v)) == 1:

    ans = n // 2

else:

    lst_odd = [lst_v[i] for i in range(n) if i%2==0]

    lst_even = [lst_v[i] for i in range(n) if i%2!=0]

    cnt_odd = sorted(list(Counter(lst_odd).items()), key=lambda x: -x[1])

    cnt_even = sorted(list(Counter(lst_even).items()), key=lambda x :-x[1])



    if cnt_odd[0][0] == cnt_even[0][0]:

        rem_number = max(cnt_odd[0][1] + cnt_even[1][1], cnt_odd[1][1] + cnt_even[0][1])

    else:

        rem_number = cnt_odd[0][1] + cnt_even[0][1]

    sum_odd = sum(t[1] for t in cnt_odd)

    sum_even = sum(t[1] for t in cnt_even)

    ans = sum_odd + sum_even - rem_number





print(ans)

from collections import Counter





n = int(eval(input()))

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





if len(set(lst_v)) == 1:

    ans = n // 2

else:

    lst_odd = lst_v[::2]

    lst_even = lst_v[1::2]

    cnt_odd = sorted(list(Counter(lst_odd).items()), key=lambda x: -x[1])

    cnt_even = sorted(list(Counter(lst_even).items()), key=lambda x :-x[1])

    o1 = cnt_odd[0]

    e1 = cnt_even[0]



    if o1[0] == e1[0]:

        o2 = cnt_odd[1] if cnt_odd[1] else (0, 0)

        e2 = cnt_even[1] if cnt_even[1] else (0, 0)

        rem_number = max(o1[1] + e2[1], o2[1] + e1[1])

    else:

        rem_number = o1[1] + e1[1]

    sum_odd = sum(t[1] for t in cnt_odd)

    sum_even = sum(t[1] for t in cnt_even)

    ans = sum_odd + sum_even - rem_number





print(ans)

from collections import Counter, OrderedDict

n = int(eval(input()))
lst_v = list(map(int, input().split()))
if len(set(lst_v)) == 1:
    ans = n // 2
else:
    lst_odd = [lst_v[i] for i in range(n) if i % 2 == 0]
    lst_even = [lst_v[i] for i in range(n) if i % 2 != 0]
    cnt_odd = sorted(list(Counter(lst_odd).items()), key=lambda x: -x[1])
    cnt_even = sorted(list(Counter(lst_even).items()), key=lambda x: -x[1])
    if cnt_odd[0][0] == cnt_even[0][0]:
        rem_number = max(cnt_odd[0][1] + cnt_even[1][1], cnt_odd[1][1] + cnt_even[0][1])
    else:
        rem_number = cnt_odd[0][1] + cnt_even[0][1]
    sum_odd = sum(t[1] for t in cnt_odd)
    sum_even = sum(t[1] for t in cnt_even)
    ans = sum_odd + sum_even - rem_number
print(ans)

from collections import Counter

n = int(eval(input()))
lst_v = list(map(int, input().split()))
if len(set(lst_v)) == 1:
    ans = n // 2
else:
    lst_odd = lst_v[::2]
    lst_even = lst_v[1::2]
    cnt_odd = sorted(list(Counter(lst_odd).items()), key=lambda x: -x[1])
    cnt_even = sorted(list(Counter(lst_even).items()), key=lambda x: -x[1])
    o1 = cnt_odd[0]
    e1 = cnt_even[0]
    if o1[0] == e1[0]:
        o2 = cnt_odd[1] if cnt_odd[1] else (0, 0)
        e2 = cnt_even[1] if cnt_even[1] else (0, 0)
        rem_number = max(o1[1] + e2[1], o2[1] + e1[1])
    else:
        rem_number = o1[1] + e1[1]
    sum_odd = sum(t[1] for t in cnt_odd)
    sum_even = sum(t[1] for t in cnt_even)
    ans = sum_odd + sum_even - rem_number
print(ans)

-from collections import Counter, OrderedDict +from collections import Counter -    lst_odd = [lst_v[i] for i in range(n) if i % 2 == 0] -    lst_even = [lst_v[i] for i in range(n) if i % 2 != 0] +    lst_odd = lst_v[::2] +    lst_even = lst_v[1::2] -    if cnt_odd[0][0] == cnt_even[0][0]: -        rem_number = max(cnt_odd[0][1] + cnt_even[1][1], cnt_odd[1][1] + cnt_even[0][1]) +    o1 = cnt_odd[0] +    e1 = cnt_even[0] +    if o1[0] == e1[0]: +        o2 = cnt_odd[1] if cnt_odd[1] else (0, 0) +        e2 = cnt_even[1] if cnt_even[1] else (0, 0) +        rem_number = max(o1[1] + e2[1], o2[1] + e1[1]) -        rem_number = cnt_odd[0][1] + cnt_even[0][1] +        rem_number = o1[1] + e1[1]