


A			:						Optional[Any]        =  [sum(int(c, 1_0) ** 2 for c in i.__str__()) for i in range(1_0_0_0_0_0)]






def 					UpperCamelCase   (      __magic_name__	:				int	)  ->    int:
		"""simple docstring"""




		lowercase__	     =						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[bool | None]        =  [None] * 1_0_0_0_0_0_0_0
A			:						List[str]        =  True
A			:						Union[str, Any]        =  False






def 					UpperCamelCase   (      __magic_name__	:				int	)  ->    bool:
		"""simple docstring"""




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

		lowercase__	     =						chain(next_number(__magic_name__	)	)
		lowercase__	     =						number_chain

		while number < 1000_0000:
				lowercase__	     =						number_chain
				number *= 10

		return number_chain






def 					UpperCamelCase   (      __magic_name__	:				int = 1000_0000	)  ->    int:
		"""simple docstring"""




		for i in range(1       ,       __magic_name__	):
				if CHAINS[i] is None:
						chain(i + 1	)

		return CHAINS[:number].count(__magic_name__	)


if __name__ == "__main__":
	import doctest

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





from typing import Optional

from .. import Features, NamedSplit
from ..packaged_modules.text.text import Text
from ..utils.typing import NestedDataStructureLike, PathLike
from .abc import AbstractDatasetReader



class 				A       (			UpperCAmelCase__				):
					'''simple docstring'''






					def __init__(self       :		Any ,   _UpperCAmelCase       :		NestedDataStructureLike[PathLike] ,   _UpperCAmelCase       :		Optional[NamedSplit] = None ,   _UpperCAmelCase       :		Optional[Features] = None ,   _UpperCAmelCase       :		str = None ,   _UpperCAmelCase       :		bool = False ,   _UpperCAmelCase       :		bool = False ,   _UpperCAmelCase       :		Optional[int] = None ,   **_UpperCAmelCase       :		Optional[int] ,   )		->  List[str]:




							"""simple docstring"""


							super().__init__(
							    _UpperCAmelCase ,   split=_UpperCAmelCase ,   features=_UpperCAmelCase ,   cache_dir=_UpperCAmelCase ,   keep_in_memory=_UpperCAmelCase ,   streaming=_UpperCAmelCase ,   num_proc=_UpperCAmelCase ,   **_UpperCAmelCase ,   )
							lowercase__	     =						path_or_paths if isinstance(_UpperCAmelCase ,   _UpperCAmelCase						) else {self.split: path_or_paths}
							lowercase__	     =						Text(
							    cache_dir=_UpperCAmelCase ,   data_files=_UpperCAmelCase ,   features=_UpperCAmelCase ,   **_UpperCAmelCase ,   )


					def     lowerCamelCase__	(self       :		Tuple						)		->  Any:




							"""simple docstring"""


							if self.streaming:
									lowercase__	     =						self.builder.as_streaming_dataset(split=self.split						)
							# Build regular (map-style) dataset
							else:
									lowercase__	     =						None
									lowercase__	     =						None
									lowercase__	     =						None
									lowercase__	     =						None

									self.builder.download_and_prepare(
									    download_config=_UpperCAmelCase ,   download_mode=_UpperCAmelCase ,   verification_mode=_UpperCAmelCase ,   base_path=_UpperCAmelCase ,   num_proc=self.num_proc ,   )
									lowercase__	     =						self.builder.as_dataset(
									    split=self.split ,   verification_mode=_UpperCAmelCase ,   in_memory=self.keep_in_memory						)
							return dataset

