n,*v = list(map(int,open(0).read().split()))

v0,v1 = {},{}

flg = True

for i in v:

    if flg:

        v0[i]= v0[i]+1 if i in v0 else 1

    else:    

        v1[i]= v1[i]+1 if i in v1 else 1

    flg = not flg

len0,len1 = len(v0),len(v1)

if len0==1 and len1==1:

    if list(v0.keys()) != list(v1.keys()):

        print((0))

    else:

        sv = sorted(v1.values())[0]

        print(sv)

elif len0 == 1:

    sort_v1 = sorted(list(v1.items()),key=lambda x:x[1])

    sum1 = sum(v1.values())

    print((sum1 - max(v1.values())))

elif len1 == 1:

    sort_v0 = sorted(list(v0.items()),key=lambda x:x[1])

    sum0 = sum(v0.values())

    print((sum0 - max(v0.values())))

else:

    sort_v1 = sorted(list(v1.items()),key=lambda x:x[1])

    sort_v0 = sorted(list(v0.items()),key=lambda x:x[1])

    #print(sort_v0,sort_v1)

    if sort_v0[-1][0] != sort_v1[-1][0]:

        sum0 = sum(v0.values()) - sort_v0[-1][1]

        sum1 = sum(v1.values()) - sort_v1[-1][1]

        print((sum0 + sum1))

    else:

        sum0 = sum(v0.values())

        sum1 = sum(v1.values())

        sum0_1 = sum0 - sort_v0[-1][1]

        sum0_2 = sum0 - sort_v0[-2][1]

        sum1_1 = sum1 - sort_v1[-1][1]

        sum1_2 = sum1 - sort_v1[-2][1]

        print((min(sum0_1 + sum1_2 , sum0_2 + sum1_1)))



from collections import Counter



n,*v = list(map(int,open(0).read().split()))

v0,v1 = Counter(v[::2]),Counter(v[1::2])

len0,len1 = len(v0),len(v1)

if len0==1 and len1==1:

    if list(v0.keys()) != list(v1.keys()):

        print((0))

    else:

        sv = sorted(v1.values())[0]

        print(sv)

elif len0 == 1:

    print((sum(v1.values()) - max(v1.values())))

elif len1 == 1:

    print((sum(v0.values()) - max(v0.values())))

else:

    v0_1,v0_2 = v0.most_common(2)

    v1_1,v1_2 = v1.most_common(2)

    if v0_1[0] != v1_1[0]:

        sum0 = sum(v0.values()) - v0_1[1]

        sum1 = sum(v1.values()) - v1_1[1]

        print((sum0 + sum1))

    else:

        sum0 = sum(v0.values())

        sum1 = sum(v1.values())

        sum0_1 = sum0 - v0_1[1]

        sum0_2 = sum0 - v0_2[1]

        sum1_1 = sum1 - v1_1[1]

        sum1_2 = sum1 - v1_2[1]

        print((min(sum0_1 + sum1_2 , sum0_2 + sum1_1)))
n, *v = list(map(int, open(0).read().split()))
v0, v1 = {}, {}
flg = True
for i in v:
    if flg:
        v0[i] = v0[i] + 1 if i in v0 else 1
    else:
        v1[i] = v1[i] + 1 if i in v1 else 1
    flg = not flg
len0, len1 = len(v0), len(v1)
if len0 == 1 and len1 == 1:
    if list(v0.keys()) != list(v1.keys()):
        print((0))
    else:
        sv = sorted(v1.values())[0]
        print(sv)
elif len0 == 1:
    sort_v1 = sorted(list(v1.items()), key=lambda x: x[1])
    sum1 = sum(v1.values())
    print((sum1 - max(v1.values())))
elif len1 == 1:
    sort_v0 = sorted(list(v0.items()), key=lambda x: x[1])
    sum0 = sum(v0.values())
    print((sum0 - max(v0.values())))
else:
    sort_v1 = sorted(list(v1.items()), key=lambda x: x[1])
    sort_v0 = sorted(list(v0.items()), key=lambda x: x[1])
    # print(sort_v0,sort_v1)
    if sort_v0[-1][0] != sort_v1[-1][0]:
        sum0 = sum(v0.values()) - sort_v0[-1][1]
        sum1 = sum(v1.values()) - sort_v1[-1][1]
        print((sum0 + sum1))
    else:
        sum0 = sum(v0.values())
        sum1 = sum(v1.values())
        sum0_1 = sum0 - sort_v0[-1][1]
        sum0_2 = sum0 - sort_v0[-2][1]
        sum1_1 = sum1 - sort_v1[-1][1]
        sum1_2 = sum1 - sort_v1[-2][1]
        print((min(sum0_1 + sum1_2, sum0_2 + sum1_1)))

from collections import Counter

n, *v = list(map(int, open(0).read().split()))
v0, v1 = Counter(v[::2]), Counter(v[1::2])
len0, len1 = len(v0), len(v1)
if len0 == 1 and len1 == 1:
    if list(v0.keys()) != list(v1.keys()):
        print((0))
    else:
        sv = sorted(v1.values())[0]
        print(sv)
elif len0 == 1:
    print((sum(v1.values()) - max(v1.values())))
elif len1 == 1:
    print((sum(v0.values()) - max(v0.values())))
else:
    v0_1, v0_2 = v0.most_common(2)
    v1_1, v1_2 = v1.most_common(2)
    if v0_1[0] != v1_1[0]:
        sum0 = sum(v0.values()) - v0_1[1]
        sum1 = sum(v1.values()) - v1_1[1]
        print((sum0 + sum1))
    else:
        sum0 = sum(v0.values())
        sum1 = sum(v1.values())
        sum0_1 = sum0 - v0_1[1]
        sum0_2 = sum0 - v0_2[1]
        sum1_1 = sum1 - v1_1[1]
        sum1_2 = sum1 - v1_2[1]
        print((min(sum0_1 + sum1_2, sum0_2 + sum1_1)))

+from collections import Counter + -v0, v1 = {}, {} -flg = True -for i in v: -    if flg: -        v0[i] = v0[i] + 1 if i in v0 else 1 -    else: -        v1[i] = v1[i] + 1 if i in v1 else 1 -    flg = not flg +v0, v1 = Counter(v[::2]), Counter(v[1::2]) -    sort_v1 = sorted(list(v1.items()), key=lambda x: x[1]) -    sum1 = sum(v1.values()) -    print((sum1 - max(v1.values()))) +    print((sum(v1.values()) - max(v1.values()))) -    sort_v0 = sorted(list(v0.items()), key=lambda x: x[1]) -    sum0 = sum(v0.values()) -    print((sum0 - max(v0.values()))) +    print((sum(v0.values()) - max(v0.values()))) -    sort_v1 = sorted(list(v1.items()), key=lambda x: x[1]) -    sort_v0 = sorted(list(v0.items()), key=lambda x: x[1]) -    # print(sort_v0,sort_v1) -    if sort_v0[-1][0] != sort_v1[-1][0]: -        sum0 = sum(v0.values()) - sort_v0[-1][1] -        sum1 = sum(v1.values()) - sort_v1[-1][1] +    v0_1, v0_2 = v0.most_common(2) +    v1_1, v1_2 = v1.most_common(2) +    if v0_1[0] != v1_1[0]: +        sum0 = sum(v0.values()) - v0_1[1] +        sum1 = sum(v1.values()) - v1_1[1] -        sum0_1 = sum0 - sort_v0[-1][1] -        sum0_2 = sum0 - sort_v0[-2][1] -        sum1_1 = sum1 - sort_v1[-1][1] -        sum1_2 = sum1 - sort_v1[-2][1] +        sum0_1 = sum0 - v0_1[1] +        sum0_2 = sum0 - v0_2[1] +        sum1_1 = sum1 - v1_1[1] +        sum1_2 = sum1 - v1_2[1]