

"""simple docstring"""




__A	:       str        =						{
    '0': 1,
    '1': 1,
    '2': 2,
    '3': 6,
    '4': 24,
    '5': 1_20,
    '6': 7_20,
    '7': 50_40,
    '8': 4_03_20,
    '9': 36_28_80,
}

__A	:       List[str]        =						{1_45: 1_45}

__A	:       str        =						{
    1_45: 0,
    1_69: 3,
    3_63_01: 3,
    14_54: 3,
    8_71: 2,
    4_53_61: 2,
    8_72: 2,
}
def   __SCREAMING_SNAKE_CASE		(		lowercase__ ):
					"""simple docstring"""
					if n in CACHE_SUM_DIGIT_FACTORIALS:
										return CACHE_SUM_DIGIT_FACTORIALS[n]
					A     =   sum(DIGIT_FACTORIALS[let] for let in str(lowercase__ ) )
					A     =   ret
					return ret
def   __SCREAMING_SNAKE_CASE		(		lowercase__     ,				lowercase__ = None ):
					"""simple docstring"""
					A     =   previous or set()
					if n in CHAIN_LENGTH_CACHE:
										return CHAIN_LENGTH_CACHE[n]
					A     =   sum_digit_factorials(lowercase__ )
					if next_number in previous:
										A     =   0
										return 0
					else:
										previous.add(lowercase__ )
										A     =   1 + chain_length(lowercase__     ,				lowercase__ )
										A     =   ret
										return ret
def   __SCREAMING_SNAKE_CASE		(		lowercase__ = 60     ,				lowercase__ = 1_000_000 ):
					"""simple docstring"""
					return sum(1 for i in range(1     ,				lowercase__ ) if chain_length(lowercase__ ) == num_terms )


if __name__ == "__main__":
	print(f"""{solution() = }""")











import math






def 				UpperCAmelCase__  (							_A			):






  """simple docstring"""


  a_		    =  math.log(2      ,      10			) * number
  a_		    =  round((log_number - int(_A			))      ,      15			)

  return difference






def 				UpperCAmelCase__  (							_A = 678_910			):






  """simple docstring"""


  a_		    =  90
  a_		    =  0

  a_		    =  math.log(1.23      ,      10			)
  a_		    =  math.log(1.24      ,      10			)
  a_		    =  0

  while position < number:
    a_		    =  log_difference(_A			)

    if difference >= upper_limit:
      power_iterator += 93

    elif difference < lower_limit:
      power_iterator += 196

    else:
      a_		    =  power_iterator
      power_iterator += 196
      position += 1

  return previous_power


if __name__ == "__main__":
  import doctest

  doctest.testmod()

  print(F"""{solution() = }""")
