






__lowerCamelCase :      List[Any]										=				[sum(int(c, 10) ** 2 for c in i.__str__()) for i in range(10_0000)]







def 					SCREAMING_SNAKE_CASE    (			snake_case_ :							int       ):
	snake_case__			:				Optional[Any]       =  0
	while number:
		# Increased Speed Slightly by checking every 5 digits together.
		sum_of_digits_squared += DIGITS_SQUARED[number % 100000]
		number //= 100000

	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
__lowerCamelCase :      list[bool | None]										=				[None] * 1000_0000
__lowerCamelCase :      Union[str, Any]										=				True
__lowerCamelCase :      Optional[Any]										=				False







def 					SCREAMING_SNAKE_CASE    (			snake_case_ :							int       ):

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

	snake_case__			:				List[Any]       =  chain(next_number(snake_case_       )       )
	snake_case__			:				int       =  number_chain

	while number < 10000000:
		snake_case__			:				Union[str, Any]       =  number_chain
		number *= 10

	return number_chain







def 					SCREAMING_SNAKE_CASE    (			snake_case_ :							int = 10000000       ):
	for i in range(1					,  snake_case_       ):
		if CHAINS[i] is None:
			chain(i + 1       )

	return CHAINS[:number].count(snake_case_       )


if __name__ == "__main__":
	import doctest

	doctest.testmod()
	print(f"{solution() = }")











from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


__lowerCamelCase :      Any										=				{
    """configuration_instructblip""": [
        """INSTRUCTBLIP_PRETRAINED_CONFIG_ARCHIVE_MAP""",
        """InstructBlipConfig""",
        """InstructBlipQFormerConfig""",
        """InstructBlipVisionConfig""",
    ],
    """processing_instructblip""": ["""InstructBlipProcessor"""],
}

try:
	if not is_torch_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	__lowerCamelCase :      List[Any]										=				[
	    """INSTRUCTBLIP_PRETRAINED_MODEL_ARCHIVE_LIST""",
	    """InstructBlipQFormerModel""",
	    """InstructBlipPreTrainedModel""",
	    """InstructBlipForConditionalGeneration""",
	    """InstructBlipVisionModel""",
	]

if TYPE_CHECKING:
	from .configuration_instructblip import (
	    INSTRUCTBLIP_PRETRAINED_CONFIG_ARCHIVE_MAP,
	    InstructBlipConfig,
	    InstructBlipQFormerConfig,
	    InstructBlipVisionConfig,
	)
	from .processing_instructblip import InstructBlipProcessor

	try:
		if not is_torch_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .modeling_instructblip import (
		    INSTRUCTBLIP_PRETRAINED_MODEL_ARCHIVE_LIST,
		    InstructBlipForConditionalGeneration,
		    InstructBlipPreTrainedModel,
		    InstructBlipQFormerModel,
		    InstructBlipVisionModel,
		)

else:
	import sys

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



