n = int(eval(input()))

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



from collections import Counter



def minus(lis):

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

        return lis[0], 0, 10**9

    c = Counter(lis)

    f_key = max(c, key=c.get)

    second,first = sorted(c.values())[-2:]

    return f_key,len(lis)-first,len(lis)-second



def solve(n,v):

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

        return n//2

    Odd = [v[i] for i in range(n) if i%2==1]

    Even = [v[i] for i in range(n) if i%2==0]

    odd_key, odd_f,odd_s = minus(Odd)

    # print(odd_key, odd_f,odd_s)

    even_key, even_f,even_s = minus(Even)

    if odd_key == even_key:

        return min(odd_f+even_s,even_f+odd_s)

    # print(odd,even)

    return odd_f + even_f

print((solve(n,v)))
from collections import Counter

def solve():

  ans = 0

  N = int(eval(input()))

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

  V1 = [V[i] for i in range(0,N,2)]

  V2 = [V[i] for i in range(1,N,2)]

  v1 = Counter(V1)

  v2 = Counter(V2)

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

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

  if v1[0][0]!=v2[0][0]:

    ans = N-(v1[0][1]+v2[0][1])

  else:

    if len(v1)==1:

      if len(v2)==1:

        return N//2

      return N-(v1[0][1]+v2[1][1])

    if len(v2)==1:

      return N-(v1[1][1]+v2[0][1])

    ans = N-max(v1[1][1]+v2[0][1],v1[0][1]+v2[1][1])

  return ans

print((solve()))
n = int(eval(input()))
v = list(map(int, input().split()))
from collections import Counter


def minus(lis):
    if len(set(lis)) == 1:
        return lis[0], 0, 10**9
    c = Counter(lis)
    f_key = max(c, key=c.get)
    second, first = sorted(c.values())[-2:]
    return f_key, len(lis) - first, len(lis) - second


def solve(n, v):
    if len(set(v)) == 1:
        return n // 2
    Odd = [v[i] for i in range(n) if i % 2 == 1]
    Even = [v[i] for i in range(n) if i % 2 == 0]
    odd_key, odd_f, odd_s = minus(Odd)
    # print(odd_key, odd_f,odd_s)
    even_key, even_f, even_s = minus(Even)
    if odd_key == even_key:
        return min(odd_f + even_s, even_f + odd_s)
    # print(odd,even)
    return odd_f + even_f


print((solve(n, v)))

from collections import Counter


def solve():
    ans = 0
    N = int(eval(input()))
    V = list(map(int, input().split()))
    V1 = [V[i] for i in range(0, N, 2)]
    V2 = [V[i] for i in range(1, N, 2)]
    v1 = Counter(V1)
    v2 = Counter(V2)
    v1 = sorted(list(v1.items()), key=lambda x: -x[1])
    v2 = sorted(list(v2.items()), key=lambda x: -x[1])
    if v1[0][0] != v2[0][0]:
        ans = N - (v1[0][1] + v2[0][1])
    else:
        if len(v1) == 1:
            if len(v2) == 1:
                return N // 2
            return N - (v1[0][1] + v2[1][1])
        if len(v2) == 1:
            return N - (v1[1][1] + v2[0][1])
        ans = N - max(v1[1][1] + v2[0][1], v1[0][1] + v2[1][1])
    return ans


print((solve()))

-n = int(eval(input())) -v = list(map(int, input().split())) -def minus(lis): -    if len(set(lis)) == 1: -        return lis[0], 0, 10**9 -    c = Counter(lis) -    f_key = max(c, key=c.get) -    second, first = sorted(c.values())[-2:] -    return f_key, len(lis) - first, len(lis) - second +def solve(): +    ans = 0 +    N = int(eval(input())) +    V = list(map(int, input().split())) +    V1 = [V[i] for i in range(0, N, 2)] +    V2 = [V[i] for i in range(1, N, 2)] +    v1 = Counter(V1) +    v2 = Counter(V2) +    v1 = sorted(list(v1.items()), key=lambda x: -x[1]) +    v2 = sorted(list(v2.items()), key=lambda x: -x[1]) +    if v1[0][0] != v2[0][0]: +        ans = N - (v1[0][1] + v2[0][1]) +    else: +        if len(v1) == 1: +            if len(v2) == 1: +                return N // 2 +            return N - (v1[0][1] + v2[1][1]) +        if len(v2) == 1: +            return N - (v1[1][1] + v2[0][1]) +        ans = N - max(v1[1][1] + v2[0][1], v1[0][1] + v2[1][1]) +    return ans -def solve(n, v): -    if len(set(v)) == 1: -        return n // 2 -    Odd = [v[i] for i in range(n) if i % 2 == 1] -    Even = [v[i] for i in range(n) if i % 2 == 0] -    odd_key, odd_f, odd_s = minus(Odd) -    # print(odd_key, odd_f,odd_s) -    even_key, even_f, even_s = minus(Even) -    if odd_key == even_key: -        return min(odd_f + even_s, even_f + odd_s) -    # print(odd,even) -    return odd_f + even_f - - -print((solve(n, v))) +print((solve()))