



a__      :				Dict   	=			[sum(int(c, 10) ** 2 for c in i.__str__()) for i in range(10_00_00)]

def   _lowerCAmelCase   (						A__	):
      lowercase__     =  0
      while number:
            # Increased Speed Slightly by checking every 5 digits together.
            sum_of_digits_squared += DIGITS_SQUARED[number % 100_000]
            number //= 100_000

      return sum_of_digits_squared


# There are 2 Chains made,
# One ends with 89 with the chain member 58 being the one which when declared first,
# there will be the least number of iterations for all the members to be checked.

# The other one ends with 1 and has only one element 1.

# So 58 and 1 are chosen to be declared at the starting.

# Changed dictionary to an array to quicken the solution
a__      :				list[bool | None]   	=			[None] * 10_00_00_00
a__      :				Optional[Any]   	=			True
a__      :				List[Any]   	=			False

def   _lowerCAmelCase   (						A__	):

      if CHAINS[number - 1] is not None:
            return CHAINS[number - 1]  # type: ignore

      lowercase__     =  chain(next_number(A__	)	)
      lowercase__     =  number_chain

      while number < 10_000_000:
            lowercase__     =  number_chain
            number *= 10

      return number_chain

def   _lowerCAmelCase   (						A__ = 10_000_000	):
      for i in range(1						,  A__	):
            if CHAINS[i] is None:
                  chain(i + 1	)

      return CHAINS[:number].count(A__	)


if __name__ == "__main__":
       import doctest

       doctest.testmod()
       print(F'''{solution() = }''')











from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_flax_available,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
)


a__      :				Optional[int]   	=			{
    "configuration_blenderbot": [
        "BLENDERBOT_PRETRAINED_CONFIG_ARCHIVE_MAP",
        "BlenderbotConfig",
        "BlenderbotOnnxConfig",
    ],
    "tokenization_blenderbot": ["BlenderbotTokenizer"],
}

try:
       if not is_tokenizers_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       a__      :				Any   	=			["BlenderbotTokenizerFast"]

try:
       if not is_torch_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       a__      :				Dict   	=			[
           "BLENDERBOT_PRETRAINED_MODEL_ARCHIVE_LIST",
           "BlenderbotForCausalLM",
           "BlenderbotForConditionalGeneration",
           "BlenderbotModel",
           "BlenderbotPreTrainedModel",
       ]


try:
       if not is_tf_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       a__      :				List[str]   	=			[
           "TFBlenderbotForConditionalGeneration",
           "TFBlenderbotModel",
           "TFBlenderbotPreTrainedModel",
       ]


try:
       if not is_flax_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       a__      :				int   	=			[
           "FlaxBlenderbotForConditionalGeneration",
           "FlaxBlenderbotModel",
           "FlaxBlenderbotPreTrainedModel",
       ]


if TYPE_CHECKING:
       from .configuration_blenderbot import (
           BLENDERBOT_PRETRAINED_CONFIG_ARCHIVE_MAP,
           BlenderbotConfig,
           BlenderbotOnnxConfig,
       )
       from .tokenization_blenderbot import BlenderbotTokenizer

       try:
              if not is_tokenizers_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .tokenization_blenderbot_fast import BlenderbotTokenizerFast

       try:
              if not is_torch_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .modeling_blenderbot import (
                  BLENDERBOT_PRETRAINED_MODEL_ARCHIVE_LIST,
                  BlenderbotForCausalLM,
                  BlenderbotForConditionalGeneration,
                  BlenderbotModel,
                  BlenderbotPreTrainedModel,
              )

       try:
              if not is_tf_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .modeling_tf_blenderbot import (
                  TFBlenderbotForConditionalGeneration,
                  TFBlenderbotModel,
                  TFBlenderbotPreTrainedModel,
              )

       try:
              if not is_flax_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .modeling_flax_blenderbot import (
                  FlaxBlenderbotForConditionalGeneration,
                  FlaxBlenderbotModel,
                  FlaxBlenderbotPreTrainedModel,
              )

else:
       import sys

       a__      :				Optional[Any]   	=			_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)
