


from math import factorial

SCREAMING_SNAKE_CASE		:int     						=   {str(digit): factorial(digit) for digit in range(10)}



def 	_lowerCAmelCase  (							lowerCAmelCase_							:Optional[Any]							)->int:
   '''simple docstring'''






   if not isinstance(UpperCamelCase__						,  UpperCamelCase__							):
      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(UpperCamelCase__							)							)



def 	_lowerCAmelCase  (							lowerCAmelCase_							:Optional[int] = 60						,  lowerCAmelCase_							:int = 1_000_000							)->List[str]:
   '''simple docstring'''






   if not isinstance(UpperCamelCase__						,  UpperCamelCase__							) or not isinstance(UpperCamelCase__						,  UpperCamelCase__							):
      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
   snake_case_    			=    0
   # the cached sizes of the previous chains
   snake_case_    			=    {}

   for start_chain_element in range(1						,  UpperCamelCase__							):
      # The temporary set will contain the elements of the chain
      snake_case_    			=    set()
      snake_case_    			=    0

      # Stop computing the chain when you find a cached size, a repeating item or the
      # length is greater then the desired one.
      snake_case_    			=    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(UpperCamelCase__							)
         chain_set_length += 1
         snake_case_    			=    digit_factorial_sum(UpperCamelCase__							)

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

      snake_case_    			=    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"""




import warnings

from ...configuration_utils import PretrainedConfig
from ...utils import logging


_snake_case          =   logging.get_logger(__name__)

_snake_case          =   {
    'RUCAIBox/mvp': 'https://huggingface.co/RUCAIBox/mvp/resolve/main/config.json',
}






class        UpperCamelCase			(	snake_case_      ):
 UpperCamelCase					:       int			=					'''mvp'''
 UpperCamelCase					:       Union[str, Any]			=					['''past_key_values''']
 UpperCamelCase					:       Any			=					{'''num_attention_heads''': '''encoder_attention_heads''', '''hidden_size''': '''d_model'''}


 def __init__(     self		:						List[str]							,						UpperCAmelCase__		:						List[str]=50267							,						UpperCAmelCase__		:						Optional[Any]=1024							,						UpperCAmelCase__		:						Tuple=12							,						UpperCAmelCase__		:						Optional[Any]=4096							,						UpperCAmelCase__		:						int=16							,						UpperCAmelCase__		:						Tuple=12							,						UpperCAmelCase__		:						int=4096							,						UpperCAmelCase__		:						List[Any]=16							,						UpperCAmelCase__		:						Tuple=0.0							,						UpperCAmelCase__		:						Tuple=0.0							,						UpperCAmelCase__		:						Tuple="gelu"							,						UpperCAmelCase__		:						Union[str, Any]=1024							,						UpperCAmelCase__		:						List[str]=0.1							,						UpperCAmelCase__		:						Any=0.0							,						UpperCAmelCase__		:						Dict=0.0							,						UpperCAmelCase__		:						Tuple=0.0_2							,						UpperCAmelCase__		:						Tuple=0.0							,						UpperCAmelCase__		:						Optional[Any]=False							,						UpperCAmelCase__		:						int=True							,						UpperCAmelCase__		:						Tuple=1							,						UpperCAmelCase__		:						Dict=0							,						UpperCAmelCase__		:						Union[str, Any]=2							,						UpperCAmelCase__		:						Optional[int]=True							,						UpperCAmelCase__		:						Tuple=2							,						UpperCAmelCase__		:						Any=2							,						UpperCAmelCase__		:						Optional[Any]=False							,						UpperCAmelCase__		:						Dict=100							,						UpperCAmelCase__		:						Union[str, Any]=800							,						**UpperCAmelCase__		:						Dict							,						)					->       List[Any]:
   _a  :       Any             =	vocab_size
   _a  :       Any             =	max_position_embeddings
   _a  :       Union[str, Any]             =	d_model
   _a  :       List[str]             =	encoder_ffn_dim
   _a  :       List[Any]             =	encoder_layers
   _a  :       Dict             =	encoder_attention_heads
   _a  :       Tuple             =	decoder_ffn_dim
   _a  :       List[Any]             =	decoder_layers
   _a  :       Optional[Any]             =	decoder_attention_heads
   _a  :       Optional[Any]             =	dropout
   _a  :       str             =	attention_dropout
   _a  :       Dict             =	activation_dropout
   _a  :       Any             =	activation_function
   _a  :       Tuple             =	init_std
   _a  :       Dict             =	encoder_layerdrop
   _a  :       Optional[int]             =	decoder_layerdrop
   _a  :       Optional[Any]             =	classifier_dropout
   _a  :       List[Any]             =	use_cache
   _a  :       Dict             =	encoder_layers
   _a  :       str             =	scale_embedding  # scale factor will be sqrt(d_model) if True
   _a  :       int             =	use_prompt
   _a  :       Dict             =	prompt_length
   _a  :       Dict             =	prompt_mid_dim

   super().__init__(
       pad_token_id=UpperCAmelCase__							,						bos_token_id=UpperCAmelCase__							,						eos_token_id=UpperCAmelCase__							,						is_encoder_decoder=UpperCAmelCase__							,						decoder_start_token_id=UpperCAmelCase__							,						forced_eos_token_id=UpperCAmelCase__							,						**UpperCAmelCase__							,						)

   if self.forced_bos_token_id is None and kwargs.get("""force_bos_token_to_be_generated"""							,						UpperCAmelCase__							):
     _a  :       List[str]             =	self.bos_token_id
     warnings.warn(
         f"""Please make sure the config includes `forced_bos_token_id={self.bos_token_id}` in future versions. """
         """The config can simply be saved and uploaded again to be fixed."""							)

