output_description: Print the integer obtained by replacing each occurrence of `1` with `9` and
  each occurrence of `9` with `1` in n.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      n
attempt: import collections
  
  N = int(input())
  l = list(map(int, input().split()))
  
  a = []
  b = []
  a_f = 0
  b_f = 0
  a_s = 0
  b_s = 0
  for i in range(N):
      if i%2 == 0:
          a.append(l[i])
      else:
          b.append(l[i])
          
  c_a = collections.Counter(a)
  c_b = collections.Counter(b)
  
  a_f = c_a.most_common()[0]
  b_f = c_b.most_common()[0]
  
  if a_f[0] != b_f[0]:
      print(N - a_f[1] - b_f[1])
  
  elif len(set(a)) == 1 and len(set(b)) == 1:
      print(int(N/2))
  elif len(set(a)) == 1:
      print(int(N/2 - c_b.most_common()[1][1]))
  elif len(set(b)) == 1:
      print(int(N/2 - c_a.most_common()[1][1]))
  elif a_f[1] == b_f[1]:
      second_a = c_a.most_common()[1][1]
      second_b = c_b.most_common()[1][1]
      if second_a >= second_b:
          print(int(N - b_f[1] - second_a)
      else:
          print(int(N - a_f[1] - second_b)
  elif a_f[1] > b_f[1]:
      print(int(N - a_f[1] - c_b.most_common()[1][1]))
  else:
      print(int(N - b_f[1] - c_a.most_common()[1][1]))
problem_description: Statement
  
  Cat Snuke is learning to write characters. Today, he practiced writing digits
  `1` and `9`, but he did it the other way around.
  
  You are given a three-digit integer n written by Snuke. Print the integer
  obtained by replacing each digit `1` with `9` and each digit `9` with `1` in
  n.
samples: [{"input": "119", "output": "991\n    \n\nReplace the `9` in the ones place with `1`, the `1` in the tens place with `9`\nand the `1` in the hundreds place with `9`. The answer is `991`.\n\n* * *"}, {"input": "999", "output": "111"}]