


'''simple docstring'''



from math import factorial

__lowercase     :						dict[str, int]	=     {str(digit): factorial(digit) for digit in range(10)}






def   lowerCamelCase							(_SCREAMING_SNAKE_CASE				:       int       ):
					if not isinstance(_SCREAMING_SNAKE_CASE						,				_SCREAMING_SNAKE_CASE       ):
										raise TypeError('Parameter number must be int'       )

					if number < 0:
										raise ValueError('Parameter number must be greater than or equal to 0'       )

					# Converts number in string to iterate on its digits and adds its factorial.
					return sum(DIGIT_FACTORIAL[digit] for digit in str(_SCREAMING_SNAKE_CASE       )       )






def   lowerCamelCase							(_SCREAMING_SNAKE_CASE				:       int = 60						,				_SCREAMING_SNAKE_CASE				:       int = 1_000_000       ):

					if not isinstance(_SCREAMING_SNAKE_CASE						,				_SCREAMING_SNAKE_CASE       ) or not isinstance(_SCREAMING_SNAKE_CASE						,				_SCREAMING_SNAKE_CASE       ):
										raise TypeError('Parameters chain_length and number_limit must be int'       )

					if chain_length <= 0 or number_limit <= 0:
										raise ValueError(
										    'Parameters chain_length and number_limit must be greater than 0'       )

					# the counter for the chains with the exact desired length
					__a      :	Optional[Any]    =  0
					# the cached sizes of the previous chains
					__a      :	dict[int, int]    =  {}

					for start_chain_element in range(1						,				_SCREAMING_SNAKE_CASE       ):
										# The temporary set will contain the elements of the chain
										__a      :	Union[str, Any]    =  set()
										__a      :	Dict    =  0

										# Stop computing the chain when you find a cached size, a repeating item or the
										# length is greater then the desired one.
										__a      :	Any    =  start_chain_element
										while (
										    chain_element not in chain_sets_lengths
										    and chain_element not in chain_set
										    and chain_set_length <= chain_length
										):
															chain_set.add(_SCREAMING_SNAKE_CASE       )
															chain_set_length += 1
															__a      :	int    =  digit_factorial_sum(_SCREAMING_SNAKE_CASE       )

										if chain_element in chain_sets_lengths:
															chain_set_length += chain_sets_lengths[chain_element]

										__a      :	str    =  chain_set_length

										# If chain contains the exact amount of elements increase the counter
										if chain_set_length == chain_length:
															chains_counter += 1

					return chains_counter


if __name__ == "__main__":
	import doctest

	doctest.testmod()
	print(f'''{solution()}''')







'''simple docstring'''



from __future__ import annotations

from typing import Dict

from ...configuration_utils import PretrainedConfig


__lowercase     :						List[Any]	=     {
    'susnato/ernie-m-base_pytorch': 'https://huggingface.co/susnato/ernie-m-base_pytorch/blob/main/config.json',
    'susnato/ernie-m-large_pytorch': 'https://huggingface.co/susnato/ernie-m-large_pytorch/blob/main/config.json',
}





class 							__UpperCamelCase    (		lowerCAmelCase_ ):
	A_           =   "ernie_m"
	A_           =   {"dropout": "classifier_dropout", "num_classes": "num_labels"}




	def __init__(       self						,    __a = 25_0002						,    __a = 768						,    __a = 12						,    __a = 12						,    __a = 3072						,    __a = "gelu"						,    __a = 0.1						,    __a = 0.1						,    __a = 514						,    __a = 0.02						,    __a = 1						,    __a = 1E-0_5						,    __a=None						,    __a=False						,    __a=0.0						,    **__a						,    ):

						'''simple docstring'''





						super().__init__(pad_token_id=__a						,    **__a							)
						__a      :	int    =  vocab_size
						__a      :	Dict    =  hidden_size
						__a      :	str    =  num_hidden_layers
						__a      :	Dict    =  num_attention_heads
						__a      :	List[str]    =  intermediate_size
						__a      :	Union[str, Any]    =  hidden_act
						__a      :	List[Any]    =  hidden_dropout_prob
						__a      :	str    =  attention_probs_dropout_prob
						__a      :	Any    =  max_position_embeddings
						__a      :	int    =  initializer_range
						__a      :	Dict    =  layer_norm_eps
						__a      :	int    =  classifier_dropout
						__a      :	Dict    =  is_decoder
						__a      :	int    =  act_dropout



