'''simple docstring'''




_A										= {
    '0': 1,
    '1': 1,
    '2': 2,
    '3': 6,
    '4': 2_4,
    '5': 1_2_0,
    '6': 7_2_0,
    '7': 5_0_4_0,
    '8': 4_0_3_2_0,
    '9': 3_6_2_8_8_0,
}

_A										= {1_4_5: 1_4_5}

_A										= {
    1_4_5: 0,
    1_6_9: 3,
    3_6_3_0_1: 3,
    1_4_5_4: 3,
    8_7_1: 2,
    4_5_3_6_1: 2,
    8_7_2: 2,
}

def _UpperCamelCase (							SCREAMING_SNAKE_CASE_				):

     if n in CACHE_SUM_DIGIT_FACTORIALS:
          return CACHE_SUM_DIGIT_FACTORIALS[n]
     lowercase_       :							Union[str, Any]  					=       sum(DIGIT_FACTORIALS[let] for let in str(lowercase_				)				)
     lowercase_       :							int  					=       ret
     return ret

def _UpperCamelCase (							SCREAMING_SNAKE_CASE_	,							SCREAMING_SNAKE_CASE_ = None				):
     lowercase_       :							List[Any]  					=       previous or set()
     if n in CHAIN_LENGTH_CACHE:
          return CHAIN_LENGTH_CACHE[n]
     lowercase_       :							List[str]  					=       sum_digit_factorials(lowercase_				)
     if next_number in previous:
          lowercase_       :							int  					=       0
          return 0
     else:
          previous.add(lowercase_				)
          lowercase_       :							Tuple  					=       1 + chain_length(lowercase_	,							lowercase_				)
          lowercase_       :							Tuple  					=       ret
          return ret

def _UpperCamelCase (							SCREAMING_SNAKE_CASE_ = 60	,							SCREAMING_SNAKE_CASE_ = 1_000_000				):
     return sum(1 for i in range(1	,							lowercase_				) if chain_length(lowercase_				) == num_terms				)


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












import copy

from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ..auto.configuration_auto import AutoConfig


__UpperCAmelCase      =				logging.get_logger(__name__)
class 	a_(		lowercase__	):



     """simple docstring"""



     __snake_case		:				Union[str, Any]  					='''speech-encoder-decoder'''
     __snake_case		:				List[Any]  					=True





     def __init__(		self					:	Any  ,  **lowerCAmelCase__					:	List[Any])							->	Tuple:

      """simple docstring"""
      super().__init__(**lowerCAmelCase__)
      if "encoder" not in kwargs or "decoder" not in kwargs:
       raise ValueError(
           f'''A configuraton of type {self.model_type} cannot be instantiated because not both `encoder` and'''
           f''' `decoder` sub-configurations are passed, but only {kwargs}''')

      SCREAMING_SNAKE_CASE				    =		kwargs.pop('encoder')
      SCREAMING_SNAKE_CASE				    =		encoder_config.pop('model_type')
      SCREAMING_SNAKE_CASE				    =		kwargs.pop('decoder')
      SCREAMING_SNAKE_CASE				    =		decoder_config.pop('model_type')

      SCREAMING_SNAKE_CASE				    =		AutoConfig.for_model(lowerCAmelCase__  ,  **lowerCAmelCase__)
      SCREAMING_SNAKE_CASE				    =		AutoConfig.for_model(lowerCAmelCase__  ,  **lowerCAmelCase__)
      SCREAMING_SNAKE_CASE				    =		True





     @classmethod
     def     __UpperCamelCase						(		cls					:	str  ,  lowerCAmelCase__					:	PretrainedConfig  ,  lowerCAmelCase__					:	PretrainedConfig  ,  **lowerCAmelCase__					:	List[str])							->	PretrainedConfig:

      """simple docstring"""
      logger.info('Setting `config.is_decoder=True` and `config.add_cross_attention=True` for decoder_config')
      SCREAMING_SNAKE_CASE				    =		True
      SCREAMING_SNAKE_CASE				    =		True

      return cls(encoder=encoder_config.to_dict()  ,  decoder=decoder_config.to_dict()  ,  **lowerCAmelCase__)





     def     __UpperCamelCase						(		self					:	str)							->	Union[str, Any]:

      """simple docstring"""
      SCREAMING_SNAKE_CASE				    =		copy.deepcopy(self.__dict__)
      SCREAMING_SNAKE_CASE				    =		self.encoder.to_dict()
      SCREAMING_SNAKE_CASE				    =		self.decoder.to_dict()
      SCREAMING_SNAKE_CASE				    =		self.__class__.model_type
      return output




