


_UpperCAmelCase      :	Tuple  ={
    """0""": 1,
    """1""": 1,
    """2""": 2,
    """3""": 6,
    """4""": 24,
    """5""": 120,
    """6""": 720,
    """7""": 5040,
    """8""": 4_0320,
    """9""": 36_2880,
}

_UpperCAmelCase      :	int  ={145: 145}

_UpperCAmelCase      :	Optional[int]  ={
    145: 0,
    169: 3,
    3_6301: 3,
    1454: 3,
    871: 2,
    4_5361: 2,
    872: 2,
}



def       lowerCAmelCase			(		lowerCAmelCase_			)->			int:







				if n in CACHE_SUM_DIGIT_FACTORIALS:
								return CACHE_SUM_DIGIT_FACTORIALS[n]
				lowerCAmelCase_			:   List[Any]     					=					sum(DIGIT_FACTORIALS[let] for let in str(lowerCAmelCase_			)			)
				lowerCAmelCase_			:   Optional[int]     					=					ret
				return ret



def       lowerCAmelCase			(		lowerCAmelCase_			, lowerCAmelCase_ = None			)->			int:
				lowerCAmelCase_			:   Optional[Any]     					=					previous or set()
				if n in CHAIN_LENGTH_CACHE:
								return CHAIN_LENGTH_CACHE[n]
				lowerCAmelCase_			:   Tuple     					=					sum_digit_factorials(lowerCAmelCase_			)
				if next_number in previous:
								lowerCAmelCase_			:   Union[str, Any]     					=					0
								return 0
				else:
								previous.add(lowerCAmelCase_			)
								lowerCAmelCase_			:   str     					=					1 + chain_length(lowerCAmelCase_			, lowerCAmelCase_			)
								lowerCAmelCase_			:   Dict     					=					ret
								return ret



def       lowerCAmelCase			(		lowerCAmelCase_ = 60			, lowerCAmelCase_ = 1_000_000			)->			int:
				return sum(1 for i in range(1			, lowerCAmelCase_			) if chain_length(lowerCAmelCase_			) == num_terms			)


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


"""simple docstring"""
from collections import defaultdict







def       UpperCamelCase_					(     lowerCamelCase							:					str   )						->     dict:



       """simple docstring"""







       __magic_name__			:		defaultdict[str, int]        =     defaultdict(lowerCamelCase   )
       # Creating a dictionary containing count of each word
       for word in sentence.split():
              occurrence[word] += 1
       return occurrence


if __name__ == "__main__":
 for word, count in word_occurrence("""INPUT STRING""").items():
  print(F"""{word}: {count}""")
