
"""simple docstring"""




_A			:       Union[str, Any]   		=       [sum(int(c, 10) ** 2 for c in i.__str__()) for i in range(10_00_00)]


def   __magic_name__	(      __snake_case				:       int  ) ->				Union[str, Any]:
       lowercase    :				Union[str, Any]       		=							0
       while number:
              # Increased Speed Slightly by checking every 5 digits together.
              sum_of_digits_squared += DIGITS_SQUARED[number % 10_0000]
              number //= 10_0000

       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[str]   		=       [None] * 10_00_00_00
_A			:       Optional[Any]   		=       True
_A			:       List[Any]   		=       False


def   __magic_name__	(      __snake_case				:       int  ) ->				Tuple:

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

       lowercase    :				List[Any]       		=							chain(next_number(__a  )  )
       lowercase    :				Union[str, Any]       		=							number_chain

       while number < 1000_0000:
              lowercase    :				Optional[Any]       		=							number_chain
              number *= 10

       return number_chain


def   __magic_name__	(      __snake_case				:       int = 1000_0000  ) ->				Union[str, Any]:

       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() = }")




'''simple docstring'''







import os

from huggingface_hub.constants import HUGGINGFACE_HUB_CACHE, hf_cache_home


__lowerCAmelCase         =    HUGGINGFACE_HUB_CACHE


__lowerCAmelCase         =    """config.json"""
__lowerCAmelCase         =    """diffusion_pytorch_model.bin"""
__lowerCAmelCase         =    """diffusion_flax_model.msgpack"""
__lowerCAmelCase         =    """model.onnx"""
__lowerCAmelCase         =    """diffusion_pytorch_model.safetensors"""
__lowerCAmelCase         =    """weights.pb"""
__lowerCAmelCase         =    """https://huggingface.co"""
__lowerCAmelCase         =    default_cache_path
__lowerCAmelCase         =    """diffusers_modules"""
__lowerCAmelCase         =    os.getenv("""HF_MODULES_CACHE""", os.path.join(hf_cache_home, """modules"""))
__lowerCAmelCase         =    ["""fp16""", """non-ema"""]
__lowerCAmelCase         =    """.self_attn"""



