output_description: Print the answer.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
attempt: n = int(input())
  i = 0
  flag = 0
  m = [0, 0, 0, 0]
  
  m[0] = n // 1000
  m[1] = n // 100 - m[0] * 10
  m[2] = n // 10 - m[0] * 100 - m[1] * 10
  m[3] = n - m[0] * 1000 - m[1] * 100 - m[2] * 10
  
  while i <= 3:
      if m[i] == 2:
          flag = flag + 1
      i = i + 1
  print(flag)
  
problem_description: Statement
  
  You are given an integer N that has exactly four digits in base ten. How many
  times does `2` occur in the base-ten representation of N?
samples: [{"input": "1222", "output": "3\n    \n\n`2` occurs three times in `1222`. By the way, this contest is held on December\n22 (JST).\n\n* * *"}, {"input": "3456", "output": "0\n    \n\n* * *"}, {"input": "9592", "output": "1"}]