output_description: Print the answer.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
attempt: N = int(input())
  
  
  def digitSum(s):
      count = 0
      x1 = s // 10**4
      x2 = (s - x1 * 10**4) // 10**3
      x3 = (s - x2 * 10**3 - x1 * 10**4) // 10**2
      x4 = (s - x3 * 10**2 - x2 * 10**3 - x1 * 10**4) // 10
      x5 = s - x4 * 10 - x3 * 10**2 - x2 * 10**3 - x1 * 10**4
  
      if x2 == 2:
          count += 1
      if x3 == 2:
          count += 1
      if x4 == 2:
          count += 1
      if x5 == 2:
          count += 1
  
      return count
  
  
  print(digitSum(N))
  
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"}]