






UpperCAmelCase__				   =		[sum(int(c, 10) ** 2 for c in i.__str__()) for i in range(100000)]
def 						_a    (      a :int )							->			int:
 a		  =      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
UpperCAmelCase__				   =		[None] * 10000000
UpperCAmelCase__				   =		True
UpperCAmelCase__				   =		False
def 						_a    (      a :int )							->			bool:

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

 a		  =      chain(next_number(a ) )
 a		  =      number_chain

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

 return number_chain
def 						_a    (      a :int = 10_000_000 )							->			int:
 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 __future__ import annotations

from collections.abc import Iterable, Iterator
from dataclasses import dataclass

SCREAMING_SNAKE_CASE       :      Tuple												= (3, 9, -11, 0, 7, 5, 1, -1)
SCREAMING_SNAKE_CASE       :      Union[str, Any]												= (4, 6, 2, 0, 8, 10, 3, -2)






@dataclass
class _lowerCamelCase:
       lowercase_ :	int
       lowercase_ :	Node | None






class _lowerCamelCase:
       def __init__(					self,      lowerCamelCase)       ->   None:




           """simple docstring"""

           _lowercase       :							Node | None      		=		None
           for i in sorted(lowerCamelCase,      reverse=lowerCamelCase):
               _lowercase       :							Tuple      		=		Node(lowerCamelCase,      self.head)
       def __iter__(					self)       ->   Iterator[int]:




           """simple docstring"""

           _lowercase       :							Union[str, Any]      		=		self.head
           while node:
               yield node.data
               _lowercase       :							int      		=		node.next_node
       def __len__(					self)       ->   int:




           """simple docstring"""

           return sum(1 for _ in self)




       def __str__(					self)       ->   str:




           """simple docstring"""

           return " -> ".join([str(lowerCamelCase) for node in self])



def 				UpperCamelCase_(      lowerCamelCase_							, lowerCamelCase_ )    ->						SortedLinkedList:
    return SortedLinkedList(list(lowerCamelCase_ ) + list(lowerCamelCase_ ) )


if __name__ == "__main__":
 import doctest

 doctest.testmod()
 SCREAMING_SNAKE_CASE       :      int												= SortedLinkedList
 print(merge_lists(SSL(test_data_odd), SSL(test_data_even)))


