output_description: Print the minimum number of elements that needs to be replaced.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      n
      v_1 v_2 ... v_n
attempt: # -*- coding: utf-8 -*-
  import sys
  import math
  import os
  import itertools
  import string
  import heapq
  import _collections
  from collections import Counter
  from collections import defaultdict
  from functools import lru_cache
  import bisect
  import re
  import queue
  
  
  class Scanner:
      @staticmethod
      def int():
          return int(sys.stdin.readline().rstrip())
  
      @staticmethod
      def string():
          return sys.stdin.readline().rstrip()
  
      @staticmethod
      def map_int():
          return [int(x) for x in Scanner.string().split()]
  
      @staticmethod
      def string_list(n):
          return [input() for i in range(n)]
  
      @staticmethod
      def int_list_list(n):
          return [Scanner.map_int() for i in range(n)]
  
      @staticmethod
      def int_cols_list(n):
          return [int(input()) for i in range(n)]
  
  
  class Math:
      @staticmethod
      def gcd(a, b):
          if b == 0:
              return a
          return Math.gcd(b, a % b)
  
      @staticmethod
      def lcm(a, b):
          return (a * b) // Math.gcd(a, b)
  
      @staticmethod
      def roundUp(a, b):
          return -(-a // b)
  
      @staticmethod
      def toUpperMultiple(a, x):
          return Math.roundUp(a, x) * x
  
      @staticmethod
      def toLowerMultiple(a, x):
          return (a // x) * x
  
      @staticmethod
      def nearPow2(n):
          if n <= 0:
              return 0
          if n & (n - 1) == 0:
              return n
          ret = 1
          while n > 0:
              ret <<= 1
              n >>= 1
          return ret
  
      @staticmethod
      def sign(n):
          if n == 0:
              return 0
          if n < 0:
              return -1
          return 1
  
      @staticmethod
      def isPrime(n):
          if n < 2:
              return False
          if n == 2:
              return True
          if n % 2 == 0:
              return False
          d = int(n**0.5) + 1
          for i in range(3, d + 1, 2):
              if n % i == 0:
                  return False
          return True
  
  
  class PriorityQueue:
      def __init__(self, l=[]):
          self.__q = l
          heapq.heapify(self.__q)
          return
  
      def push(self, n):
          heapq.heappush(self.__q, n)
          return
  
      def pop(self):
          return heapq.heappop(self.__q)
  
  
  MOD = int(1e09) + 7
  INF = int(1e15)
  
  
  def calc(N):
      return sum(int(x) for x in str(N))
  
  
  def main():
      # sys.stdin = open("sample.txt")
      N = Scanner.int()
      V = Scanner.map_int()
      V_MAX = int(1e05) + 1
      mode1, mode2 = [0] * V_MAX, [0] * V_MAX
      for i in range(N):
          if i % 2 == 0:
              mode1[V[i]] += 1
          else:
              mode2[V[i]] += 1
  
      m1, m2 = mode1.index(max(mode1)), mode2.index(max(mode2))
      if not m1 == m2:
          ans = 0
          for i in range(N):
              if i % 2 == 0:
                  if V[i] != m1:
                      ans += 1
              else:
                  if V[i] != m2:
                      ans += 1
          print(ans)
          return
      m3 = mode1.index(sorted(mode1)[-2]) if len(mode1) != 1 else -1
      m4 = mode2.index(sorted(mode2)[-2]) if len(mode2) != 1 else -1
      c1, c2, c3, c4 = 0, 0, 0, 0
      for i in range(N):
          if i % 2 == 0:
              if V[i] != m1:
                  c1 += 1
              if V[i] != m3:
                  c3 += 1
          else:
              if V[i] != m2:
                  c2 += 1
              if V[i] != m4:
                  c4 += 1
      print(min(c1 + c4, c2 + c3))
      return
  
  
  if __name__ == "__main__":
      main()
  
problem_description: Statement
  
  A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following
  conditions are satisfied:
  
    * For each i = 1,2,..., n-2, a_i = a_{i+2}.
    * Exactly two different numbers appear in the sequence.
  
  You are given a sequence v_1,v_2,...,v_n whose length is even. We would like
  to make this sequence /\/\/\/ by replacing some of its elements. Find the
  minimum number of elements that needs to be replaced.
samples: [{"input": "4\n    3 1 3 2", "output": "1\n    \n\nThe sequence 3,1,3,2 is not /\\/\\/\\/, but we can make it /\\/\\/\\/ by replacing\none of its elements: for example, replace the fourth element to make it\n3,1,3,1.\n\n* * *"}, {"input": "6\n    105 119 105 119 105 119", "output": "0\n    \n\nThe sequence 105,119,105,119,105,119 is /\\/\\/\\/.\n\n* * *"}, {"input": "4\n    1 1 1 1", "output": "2\n    \n\nThe elements of the sequence 1,1,1,1 are all the same, so it is not /\\/\\/\\/."}]