# -*- coding: utf-8 -*-

"""

Created on Thu Sep 17 20:29:30 2020



@author: liang

"""



n = int(eval(input()))

E = list()

O = list()

i = 0

for v in input().split():

    if i%2 == 0:

        E.append(int(v))

    else:

        O.append(int(v))

    i += 1

#print(E)

#print(O)

edic = {-1:0}

odic = {-1:0}

for e in E:

    if e not in list(edic.keys()):

        edic[e] = 1

    else:

        edic[e] += 1



for o in O:

    if o not in list(odic.keys()):

        odic[o] = 1

    else:

        odic[o] += 1



etup = list()

otup = list()

for e in list(edic.keys()):

    etup.append((e,edic[e]))

for o in list(odic.keys()):

    otup.append((o,odic[o]))    

etup.sort(reverse=True,key=lambda x:x[1])

otup.sort(reverse=True,key=lambda x:x[1])



#print(etup)

#print(otup)

i = 0

j = 0

while True:

    ekey, etmp = etup[i]

    okey, otmp = otup[j]

    if ekey != okey:

        break

    if etup[i+1][1] < otup[j+1][1]:

        j += 1

    else:

        i += 1

    #rint("calc")



#print(edic)



ans = n - etmp - otmp

    

print(ans)
# -*- coding: utf-8 -*-

"""

Created on Thu Sep 17 21:11:38 2020



@author: liang

"""



"""

【２番目の取得】

"""

n = int(eval(input()))

E = list()

O = list()

i = 0

for v in input().split():

    if i%2 == 0:

        E.append(int(v))

    else:

        O.append(int(v))

    i += 1

#print(E)

#print(O)

edic = {}

odic = {}

for e in E:

    if e not in list(edic.keys()):

        edic[e] = 1

    else:

        edic[e] += 1



for o in O:

    if o not in list(odic.keys()):

        odic[o] = 1

    else:

        odic[o] += 1

        

etmp = [(-1,0),(-1,0)]

otmp = [(-1,0),(-1,0)]



for key in list(edic.keys()):

    #first

    if edic[key] > etmp[0][1]:

        etmp[1] = etmp[0]

        etmp[0] = (key, edic[key])

    #second

    elif edic[key] > etmp[1][1]:

        etmp[1] = (key,edic[key])



for key in list(odic.keys()):

    #first

    if odic[key] > otmp[0][1]:

        otmp[1] = otmp[0]

        otmp[0] = (key, odic[key])

    #second

    elif odic[key] > otmp[1][1]:

        otmp[1] = (key,odic[key])



if etmp[0][0] == otmp[0][0]:

    ans = max(etmp[0][1]+otmp[1][1],etmp[1][1]+otmp[0][1])

else:

    ans = etmp[0][1]+otmp[0][1]

print((n-ans))
# -*- coding: utf-8 -*-
"""
Created on Thu Sep 17 20:29:30 2020
@author: liang
"""
n = int(eval(input()))
E = list()
O = list()
i = 0
for v in input().split():
    if i % 2 == 0:
        E.append(int(v))
    else:
        O.append(int(v))
    i += 1
# print(E)
# print(O)
edic = {-1: 0}
odic = {-1: 0}
for e in E:
    if e not in list(edic.keys()):
        edic[e] = 1
    else:
        edic[e] += 1
for o in O:
    if o not in list(odic.keys()):
        odic[o] = 1
    else:
        odic[o] += 1
etup = list()
otup = list()
for e in list(edic.keys()):
    etup.append((e, edic[e]))
for o in list(odic.keys()):
    otup.append((o, odic[o]))
etup.sort(reverse=True, key=lambda x: x[1])
otup.sort(reverse=True, key=lambda x: x[1])
# print(etup)
# print(otup)
i = 0
j = 0
while True:
    ekey, etmp = etup[i]
    okey, otmp = otup[j]
    if ekey != okey:
        break
    if etup[i + 1][1] < otup[j + 1][1]:
        j += 1
    else:
        i += 1
    # rint("calc")
# print(edic)
ans = n - etmp - otmp
print(ans)

# -*- coding: utf-8 -*-
"""
Created on Thu Sep 17 21:11:38 2020
@author: liang
"""
"""
【２番目の取得】
"""
n = int(eval(input()))
E = list()
O = list()
i = 0
for v in input().split():
    if i % 2 == 0:
        E.append(int(v))
    else:
        O.append(int(v))
    i += 1
# print(E)
# print(O)
edic = {}
odic = {}
for e in E:
    if e not in list(edic.keys()):
        edic[e] = 1
    else:
        edic[e] += 1
for o in O:
    if o not in list(odic.keys()):
        odic[o] = 1
    else:
        odic[o] += 1
etmp = [(-1, 0), (-1, 0)]
otmp = [(-1, 0), (-1, 0)]
for key in list(edic.keys()):
    # first
    if edic[key] > etmp[0][1]:
        etmp[1] = etmp[0]
        etmp[0] = (key, edic[key])
    # second
    elif edic[key] > etmp[1][1]:
        etmp[1] = (key, edic[key])
for key in list(odic.keys()):
    # first
    if odic[key] > otmp[0][1]:
        otmp[1] = otmp[0]
        otmp[0] = (key, odic[key])
    # second
    elif odic[key] > otmp[1][1]:
        otmp[1] = (key, odic[key])
if etmp[0][0] == otmp[0][0]:
    ans = max(etmp[0][1] + otmp[1][1], etmp[1][1] + otmp[0][1])
else:
    ans = etmp[0][1] + otmp[0][1]
print((n - ans))

-Created on Thu Sep 17 20:29:30 2020 +Created on Thu Sep 17 21:11:38 2020 +""" +""" +【２番目の取得】 -edic = {-1: 0} -odic = {-1: 0} +edic = {} +odic = {} -etup = list() -otup = list() -for e in list(edic.keys()): -    etup.append((e, edic[e])) -for o in list(odic.keys()): -    otup.append((o, odic[o])) -etup.sort(reverse=True, key=lambda x: x[1]) -otup.sort(reverse=True, key=lambda x: x[1]) -# print(etup) -# print(otup) -i = 0 -j = 0 -while True: -    ekey, etmp = etup[i] -    okey, otmp = otup[j] -    if ekey != okey: -        break -    if etup[i + 1][1] < otup[j + 1][1]: -        j += 1 -    else: -        i += 1 -    # rint("calc") -# print(edic) -ans = n - etmp - otmp -print(ans) +etmp = [(-1, 0), (-1, 0)] +otmp = [(-1, 0), (-1, 0)] +for key in list(edic.keys()): +    # first +    if edic[key] > etmp[0][1]: +        etmp[1] = etmp[0] +        etmp[0] = (key, edic[key]) +    # second +    elif edic[key] > etmp[1][1]: +        etmp[1] = (key, edic[key]) +for key in list(odic.keys()): +    # first +    if odic[key] > otmp[0][1]: +        otmp[1] = otmp[0] +        otmp[0] = (key, odic[key]) +    # second +    elif odic[key] > otmp[1][1]: +        otmp[1] = (key, odic[key]) +if etmp[0][0] == otmp[0][0]: +    ans = max(etmp[0][1] + otmp[1][1], etmp[1][1] + otmp[0][1]) +else: +    ans = etmp[0][1] + otmp[0][1] +print((n - ans))