

def      snake_case__      (   SCREAMING_SNAKE_CASE_		:   Optional[Any]      ):



     '''simple docstring'''





     lowercase__   :       List[str]				=	abs(_UpperCAmelCase      )
     lowercase__   :       str				=	0
     while n > 0:
          res += n % 10
          n //= 10
     return res

def      snake_case__      (   SCREAMING_SNAKE_CASE_		:   List[Any]      ):



     '''simple docstring'''





     lowercase__   :       Optional[int]				=	abs(_UpperCAmelCase      )
     return n if n < 10 else n % 10 + sum_of_digits(n // 10      )

def      snake_case__      (   SCREAMING_SNAKE_CASE_		:   Optional[Any]      ):



     '''simple docstring'''





     return sum(int(_UpperCAmelCase      ) for c in str(abs(_UpperCAmelCase      )      )      )

def      snake_case__      (   ):



     '''simple docstring'''





     from collections.abc import Callable
     from timeit import timeit

     def benchmark_a_function(SCREAMING_SNAKE_CASE_		:   Union[str, Any]     ,					SCREAMING_SNAKE_CASE_		:   List[str]      ) -> None:
          lowercase__   :       str				=	f"""{func.__name__}({value})"""
          lowercase__   :       List[str]				=	timeit(f"""__main__.{call}"""     ,					setup='import __main__'      )
          print(f"""{call:56} = {func(_UpperCAmelCase      )} -- {timing:.4f} seconds"""      )

     for value in (262_144, 1_125_899_906_842_624, 1_267_650_600_228_229_401_496_703_205_376):
          for func in (sum_of_digits, sum_of_digits_recursion, sum_of_digits_compact):
               benchmark_a_function(_UpperCAmelCase     ,					_UpperCAmelCase      )
          print()


if __name__ == "__main__":
       import doctest

       doctest.testmod()
       benchmark()




import math
import sys

def      snake_case__      (   SCREAMING_SNAKE_CASE_		:   int      ):



     '''simple docstring'''





     if number != int(SCREAMING_SNAKE_CASE_      ):
          raise ValueError('the value of input must be a natural number'      )
     if number < 0:
          raise ValueError('the value of input must not be a negative number'      )
     if number == 0:
          return 1
     lowercase__   :       Tuple				=	[-1] * (number + 1)
     lowercase__   :       Tuple				=	0
     for i in range(1     ,					number + 1      ):
          lowercase__   :       Tuple				=	sys.maxsize
          lowercase__   :       str				=	int(math.sqrt(SCREAMING_SNAKE_CASE_      )      )
          for j in range(1     ,					root + 1      ):
               lowercase__   :       List[Any]				=	1 + answers[i - (j**2)]
               lowercase__   :       str				=	min(SCREAMING_SNAKE_CASE_     ,					SCREAMING_SNAKE_CASE_      )
          lowercase__   :       List[str]				=	answer
     return answers[number]


if __name__ == "__main__":
       import doctest

       doctest.testmod()

