






"""simple docstring"""



_UpperCamelCase						:    Tuple		=						{
    '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,
}

_UpperCamelCase						:    str		=						{1_4_5: 1_4_5}

_UpperCamelCase						:    Dict		=						{
    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 		_SCREAMING_SNAKE_CASE					(       __snake_case     :    int       ):





  '''simple docstring'''





  if n in CACHE_SUM_DIGIT_FACTORIALS:
    return CACHE_SUM_DIGIT_FACTORIALS[n]
  lowercase				       =			sum(DIGIT_FACTORIALS[let] for let in str(__snake_case       )       )
  lowercase				       =			ret
  return ret
def 		_SCREAMING_SNAKE_CASE					(       __snake_case     :    int						,   __snake_case     :    set | None = None       ):





  '''simple docstring'''





  lowercase				       =			previous or set()
  if n in CHAIN_LENGTH_CACHE:
    return CHAIN_LENGTH_CACHE[n]
  lowercase				       =			sum_digit_factorials(__snake_case       )
  if next_number in previous:
    lowercase				       =			0
    return 0
  else:
    previous.add(__snake_case       )
    lowercase				       =			1 + chain_length(__snake_case						,   __snake_case       )
    lowercase				       =			ret
    return ret
def 		_SCREAMING_SNAKE_CASE					(       __snake_case     :    int = 60						,   __snake_case     :    int = 1_00_00_00       ):





  '''simple docstring'''





  return sum(1 for i in range(1						,   __snake_case       ) if chain_length(__snake_case       ) == num_terms       )


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






from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tf_available, is_torch_available


_A									=		{
    'configuration_flaubert': ['FLAUBERT_PRETRAINED_CONFIG_ARCHIVE_MAP', 'FlaubertConfig', 'FlaubertOnnxConfig'],
    'tokenization_flaubert': ['FlaubertTokenizer'],
}

try:
   if not is_torch_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   _A									=		[
       'FLAUBERT_PRETRAINED_MODEL_ARCHIVE_LIST',
       'FlaubertForMultipleChoice',
       'FlaubertForQuestionAnswering',
       'FlaubertForQuestionAnsweringSimple',
       'FlaubertForSequenceClassification',
       'FlaubertForTokenClassification',
       'FlaubertModel',
       'FlaubertWithLMHeadModel',
       'FlaubertPreTrainedModel',
   ]

try:
   if not is_tf_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   _A									=		[
       'TF_FLAUBERT_PRETRAINED_MODEL_ARCHIVE_LIST',
       'TFFlaubertForMultipleChoice',
       'TFFlaubertForQuestionAnsweringSimple',
       'TFFlaubertForSequenceClassification',
       'TFFlaubertForTokenClassification',
       'TFFlaubertModel',
       'TFFlaubertPreTrainedModel',
       'TFFlaubertWithLMHeadModel',
   ]


if TYPE_CHECKING:
   from .configuration_flaubert import FLAUBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, FlaubertConfig, FlaubertOnnxConfig
   from .tokenization_flaubert import FlaubertTokenizer

   try:
      if not is_torch_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_flaubert import (
          FLAUBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
          FlaubertForMultipleChoice,
          FlaubertForQuestionAnswering,
          FlaubertForQuestionAnsweringSimple,
          FlaubertForSequenceClassification,
          FlaubertForTokenClassification,
          FlaubertModel,
          FlaubertPreTrainedModel,
          FlaubertWithLMHeadModel,
      )

   try:
      if not is_tf_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_tf_flaubert import (
          TF_FLAUBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
          TFFlaubertForMultipleChoice,
          TFFlaubertForQuestionAnsweringSimple,
          TFFlaubertForSequenceClassification,
          TFFlaubertForTokenClassification,
          TFFlaubertModel,
          TFFlaubertPreTrainedModel,
          TFFlaubertWithLMHeadModel,
      )

else:
   import sys

   _A									=		_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)





