import collections as coll



n = int(eval(input()))

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

even = []

odd = []



for i in range(n):

	if i % 2 == 0:

		even.append(v[i])

	else:

		odd.append(v[i])



oddc = coll.Counter(odd).most_common()[:2]

evenc = coll.Counter(even).most_common()[:2]



if(len(oddc) == 1):

	oddc.append((0,0))

if(len(evenc) == 1):

	evenc.append((0,0))





if(oddc[0][0] != evenc[0][0]):

	print((n - oddc[0][1] - evenc[0][1]))

else:

	print((min(n-oddc[0][1]-evenc[1][1],n-oddc[1][1]-evenc[0][1])))
import collections as coll



n = int(eval(input()))

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

even = v[0::2]

odd = v[1::2]



oddc = coll.Counter(odd).most_common()[:2]

evenc = coll.Counter(even).most_common()[:2]



if(len(oddc) == 1):

	oddc.append((0,0))

if(len(evenc) == 1):

	evenc.append((0,0))





if(oddc[0][0] != evenc[0][0]):

	print((n - oddc[0][1] - evenc[0][1]))

else:

	print((min(n-oddc[0][1]-evenc[1][1],n-oddc[1][1]-evenc[0][1])))
import collections as coll

n = int(eval(input()))
v = list(map(int, input().split()))
even = []
odd = []
for i in range(n):
    if i % 2 == 0:
        even.append(v[i])
    else:
        odd.append(v[i])
oddc = coll.Counter(odd).most_common()[:2]
evenc = coll.Counter(even).most_common()[:2]
if len(oddc) == 1:
    oddc.append((0, 0))
if len(evenc) == 1:
    evenc.append((0, 0))
if oddc[0][0] != evenc[0][0]:
    print((n - oddc[0][1] - evenc[0][1]))
else:
    print((min(n - oddc[0][1] - evenc[1][1], n - oddc[1][1] - evenc[0][1])))

import collections as coll

n = int(eval(input()))
v = list(map(int, input().split()))
even = v[0::2]
odd = v[1::2]
oddc = coll.Counter(odd).most_common()[:2]
evenc = coll.Counter(even).most_common()[:2]
if len(oddc) == 1:
    oddc.append((0, 0))
if len(evenc) == 1:
    evenc.append((0, 0))
if oddc[0][0] != evenc[0][0]:
    print((n - oddc[0][1] - evenc[0][1]))
else:
    print((min(n - oddc[0][1] - evenc[1][1], n - oddc[1][1] - evenc[0][1])))

-even = [] -odd = [] -for i in range(n): -    if i % 2 == 0: -        even.append(v[i]) -    else: -        odd.append(v[i]) +even = v[0::2] +odd = v[1::2]