output_description: Print the answer.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
attempt: import math
  from sys import stdin
  N,P=[int(x) for x in stdin.readline().rstrip().split()]
  for i in reversed(range(round(math.pow(P,(1/N)))):
      tmp=math.pow(i,N-1)
      if P==1:
          ans=1
          break
      if N==1:
          ans=P
          break
      if (P/i)%tmp==0:
          ans=i
          break
  print(ans)
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"}]