from collections import Counter

import heapq



N = int(eval(input()))

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



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

  print((N//2))

  exit()



Veve, Vodd = [],[]

idx = 0

for v in Vs:

  if idx%2 == 0: Veve.append(v)

  else: Vodd.append(v)

  idx += 1



Veve_cnt, Vodd_cnt = [], []

[heapq.heappush(Veve_cnt, [-num,val]) for val, num in list(Counter(Veve).items())]

[heapq.heappush(Vodd_cnt, [-num,val]) for val, num in list(Counter(Vodd).items())]



neg_num, val = heapq.heappop(Veve_cnt)

eve_val = val

eve_num = -neg_num



neg_num, val = heapq.heappop(Vodd_cnt)

odd_val = val

odd_num = -neg_num



if eve_val != odd_val:

  print((N-eve_num-odd_num))

else:

  if len(Vodd_cnt) != 0:odd_num2 = -heapq.heappop(Vodd_cnt)[0]

  else:odd_num2 = -float('inf')



  if len(Veve_cnt) != 0:eve_num2 = -heapq.heappop(Veve_cnt)[0]

  else:eve_num2 = -float('inf')



  print((min(N-eve_num2-odd_num,N-eve_num-odd_num2)))
N = int(eval(input()))

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



even_idx_cnt = {}

odd_idx_cnt = {}

for idx, v in enumerate(V):

    if idx % 2 == 0:

        if v not in even_idx_cnt:

            even_idx_cnt[v] = 0

        even_idx_cnt[v] += 1

    else:

        if v not in odd_idx_cnt:

            odd_idx_cnt[v] = 0

        odd_idx_cnt[v] += 1



if len(even_idx_cnt) == 1 and len(odd_idx_cnt) == 1:

    if list(even_idx_cnt.keys()) == list(odd_idx_cnt.keys()):

        print((N - even_idx_cnt[V[0]]))

    else:

        print((0))

    exit()



even_idx_cnt = sorted(list(even_idx_cnt.items()), key=lambda  x:x[1], reverse=True)

odd_idx_cnt = sorted(list(odd_idx_cnt.items()), key=lambda  x:x[1], reverse=True)



if even_idx_cnt[0][0] != odd_idx_cnt[0][0]:

    print((N - even_idx_cnt[0][1] - odd_idx_cnt[0][1]))

else:

    ans = []

    if len(odd_idx_cnt) >= 2:

        ans.append(N - even_idx_cnt[0][1] - odd_idx_cnt[1][1])

    if len(even_idx_cnt) >= 2:

        ans.append(N - even_idx_cnt[1][1] - odd_idx_cnt[0][1])

    print((min(ans)))

from collections import Counter
import heapq

N = int(eval(input()))
Vs = list(map(int, input().split()))
if len(set(Vs)) == 1:
    print((N // 2))
    exit()
Veve, Vodd = [], []
idx = 0
for v in Vs:
    if idx % 2 == 0:
        Veve.append(v)
    else:
        Vodd.append(v)
    idx += 1
Veve_cnt, Vodd_cnt = [], []
[heapq.heappush(Veve_cnt, [-num, val]) for val, num in list(Counter(Veve).items())]
[heapq.heappush(Vodd_cnt, [-num, val]) for val, num in list(Counter(Vodd).items())]
neg_num, val = heapq.heappop(Veve_cnt)
eve_val = val
eve_num = -neg_num
neg_num, val = heapq.heappop(Vodd_cnt)
odd_val = val
odd_num = -neg_num
if eve_val != odd_val:
    print((N - eve_num - odd_num))
else:
    if len(Vodd_cnt) != 0:
        odd_num2 = -heapq.heappop(Vodd_cnt)[0]
    else:
        odd_num2 = -float("inf")
    if len(Veve_cnt) != 0:
        eve_num2 = -heapq.heappop(Veve_cnt)[0]
    else:
        eve_num2 = -float("inf")
    print((min(N - eve_num2 - odd_num, N - eve_num - odd_num2)))

N = int(eval(input()))
V = list(map(int, input().split()))
even_idx_cnt = {}
odd_idx_cnt = {}
for idx, v in enumerate(V):
    if idx % 2 == 0:
        if v not in even_idx_cnt:
            even_idx_cnt[v] = 0
        even_idx_cnt[v] += 1
    else:
        if v not in odd_idx_cnt:
            odd_idx_cnt[v] = 0
        odd_idx_cnt[v] += 1
if len(even_idx_cnt) == 1 and len(odd_idx_cnt) == 1:
    if list(even_idx_cnt.keys()) == list(odd_idx_cnt.keys()):
        print((N - even_idx_cnt[V[0]]))
    else:
        print((0))
    exit()
even_idx_cnt = sorted(list(even_idx_cnt.items()), key=lambda x: x[1], reverse=True)
odd_idx_cnt = sorted(list(odd_idx_cnt.items()), key=lambda x: x[1], reverse=True)
if even_idx_cnt[0][0] != odd_idx_cnt[0][0]:
    print((N - even_idx_cnt[0][1] - odd_idx_cnt[0][1]))
else:
    ans = []
    if len(odd_idx_cnt) >= 2:
        ans.append(N - even_idx_cnt[0][1] - odd_idx_cnt[1][1])
    if len(even_idx_cnt) >= 2:
        ans.append(N - even_idx_cnt[1][1] - odd_idx_cnt[0][1])
    print((min(ans)))

-from collections import Counter -import heapq - -Vs = list(map(int, input().split())) -if len(set(Vs)) == 1: -    print((N // 2)) +V = list(map(int, input().split())) +even_idx_cnt = {} +odd_idx_cnt = {} +for idx, v in enumerate(V): +    if idx % 2 == 0: +        if v not in even_idx_cnt: +            even_idx_cnt[v] = 0 +        even_idx_cnt[v] += 1 +    else: +        if v not in odd_idx_cnt: +            odd_idx_cnt[v] = 0 +        odd_idx_cnt[v] += 1 +if len(even_idx_cnt) == 1 and len(odd_idx_cnt) == 1: +    if list(even_idx_cnt.keys()) == list(odd_idx_cnt.keys()): +        print((N - even_idx_cnt[V[0]])) +    else: +        print((0)) -Veve, Vodd = [], [] -idx = 0 -for v in Vs: -    if idx % 2 == 0: -        Veve.append(v) -    else: -        Vodd.append(v) -    idx += 1 -Veve_cnt, Vodd_cnt = [], [] -[heapq.heappush(Veve_cnt, [-num, val]) for val, num in list(Counter(Veve).items())] -[heapq.heappush(Vodd_cnt, [-num, val]) for val, num in list(Counter(Vodd).items())] -neg_num, val = heapq.heappop(Veve_cnt) -eve_val = val -eve_num = -neg_num -neg_num, val = heapq.heappop(Vodd_cnt) -odd_val = val -odd_num = -neg_num -if eve_val != odd_val: -    print((N - eve_num - odd_num)) +even_idx_cnt = sorted(list(even_idx_cnt.items()), key=lambda x: x[1], reverse=True) +odd_idx_cnt = sorted(list(odd_idx_cnt.items()), key=lambda x: x[1], reverse=True) +if even_idx_cnt[0][0] != odd_idx_cnt[0][0]: +    print((N - even_idx_cnt[0][1] - odd_idx_cnt[0][1])) -    if len(Vodd_cnt) != 0: -        odd_num2 = -heapq.heappop(Vodd_cnt)[0] -    else: -        odd_num2 = -float("inf") -    if len(Veve_cnt) != 0: -        eve_num2 = -heapq.heappop(Veve_cnt)[0] -    else: -        eve_num2 = -float("inf") -    print((min(N - eve_num2 - odd_num, N - eve_num - odd_num2))) +    ans = [] +    if len(odd_idx_cnt) >= 2: +        ans.append(N - even_idx_cnt[0][1] - odd_idx_cnt[1][1]) +    if len(even_idx_cnt) >= 2: +        ans.append(N - even_idx_cnt[1][1] - odd_idx_cnt[0][1]) +    print((min(ans)))