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: n = int(input())
  p = list(map(int, input().split()))
  
  def count(in_list): # listを集計し、要素数が最小のものの個数
      l = list(set(in_list)) # 重複を除く
      result = [in_list.count(x) for x in l]
      return min(list(result))
  
  def method(in_list):
      l = list(set(in_list)) # 重複を除く
      result = [(in_list.count(x), x) for x in l]
      result.sort()
      return result[:2]
  
  
  
  
  def anser(n, p):
      # 例外① 全部同じ数
      sp = set(p)
      if len(sp) == 1:
          return int(n/2)
      o = [t[1] for t in enumerate(p) if t[0] % 2 == 0]
      e = [t[1] for t in enumerate(p) if t[0] % 2 == 1]
      # 例外② すでにVMVMになっているもの ①以外なのでo!=e
  
      sp = set(o)
      se = set(e)
      if len(so)) == 1 and len(se) == 1:
          return 0
      # case ① 片一方は0
      if len(so) == 1:
          return count(e)
      if len(se) == 1:
          return count(o)
      ee = method(e) # e = (個数、値)、(個数、値)
      oo = method(o) # o = (個数、値)、(個数、値)
      if ee[0][1] != oo[0][1]:
          return ee[0][0] + oo[0][0]
      else:
          return min(ee[0][0]+oo[1][0], ee[0][1]+oo[0][0])
  
  print(anser(n, p))
  
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 /\\/\\/\\/."}]