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: #!/usr/bin/env python
  import string
  import sys
  from collections import Counter
  from itertools import chain, dropwhile, takewhile
  
  
  def read(
      *shape, f=int, it=chain.from_iterable(sys.stdin), whitespaces=set(string.whitespace)
  ):
      def read_word():
          w = lambda c: c in whitespaces
          nw = lambda c: c not in whitespaces
          return f("".join(takewhile(nw, dropwhile(w, it))))
  
      if not shape:
          return read_word()
      elif len(shape) == 1:
          return [read_word() for _ in range(shape[0])]
      elif len(shape) == 2:
          return [[read_word() for _ in range(shape[1])] for _ in range(shape[0])]
  
  
  def readi(*shape):
      return read(*shape)
  
  
  def readi1(*shape):
      return [i - 1 for i in read(*shape)]
  
  
  def readf(*shape):
      return read(*shape, f=float)
  
  
  def reads(*shape):
      return read(*shape, f=str)
  
  
  def arr(*shape, fill_value=0):
      if len(shape) == 1:
          return [fill_value] * shape[fill_value]
      elif len(shape) == 2:
          return [[fill_value] * shape[1] for _ in range(shape[0])]
  
  
  def dbg(**kwargs):
      print(
          ", ".join("{} = {}".format(k, repr(v)) for k, v in kwargs.items()),
          file=sys.stderr,
      )
  
  
  def main():
      n = readi()
      v = readi(n)
      l1 = v[::2]
      l2 = v[1::2]
  
      mc1 = Counter(l1).most_common()
      mc2 = Counter(l2).most_common()
      if mc1[0][0] != mc2[0][0]:
          print((n // 2 - mc1[0][1]) + (n // 2 - mc2[0][1]))
      else:
          if len(mc1) > 1 and len(mc2) == 1:
              print((n // 2 - mc1[1][1]) + (n // 2 - mc2[0][1]))
          elif len(mc1) == 1 and len(mc2) > 1:
              print((n // 2 - mc1[0][1]) + (n // 2 - mc2[1][1]))
          elif len(mc1) > 1 and len(mc2) > 1:
              print(
                  min(
                      (n // 2 - mc1[1][1]) + (n // 2 - mc2[0][1]),
                      (n // 2 - mc1[0][1]) + (n // 2 - mc2[1][1]),
                  )
              )
          else:
              print(n // 2)
  
  
  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 /\\/\\/\\/."}]