






from __future__ import annotations

__UpperCAmelCase      =				"Alexander Joslin"





def 						A_					(						lowercase_			)				->int:







 """simple docstring"""

 if number <= 0:
  SCREAMING_SNAKE_CASE				    =		f'''n must be greater than 0. Got n = {number}'''
  raise ValueError(lowercase_			)

 SCREAMING_SNAKE_CASE				    =		[number + 1] * (number + 1)

 # starting position
 SCREAMING_SNAKE_CASE				    =		0
 for i in range(1	,  lowercase_			):
  SCREAMING_SNAKE_CASE				    =		min(table[i + 1]	,  table[i] + 1			)
  # check if out of bounds
  if i * 2 <= number:
   SCREAMING_SNAKE_CASE				    =		min(table[i * 2]	,  table[i] + 1			)
  # check if out of bounds
  if i * 3 <= number:
   SCREAMING_SNAKE_CASE				    =		min(table[i * 3]	,  table[i] + 1			)
 return table[number]


if __name__ == "__main__":
      import doctest

      doctest.testmod()







"""simple docstring"""





def 							_lowerCAmelCase   (    UpperCAmelCase  :				int   ,				UpperCAmelCase  :				int   ,				UpperCAmelCase  :				int					):


					'''simple docstring'''






					if power < 0:
										return -1
					base %= mod
					UpperCamelCase__		:     Any								=1

					while power > 0:
										if power & 1:
															UpperCamelCase__		:     Optional[Any]								=(result * base) % mod
										UpperCamelCase__		:     Union[str, Any]								=power >> 1
										UpperCamelCase__		:     Union[str, Any]								=(base * base) % mod

					return result



def 							_lowerCAmelCase   (    ):


					'''simple docstring'''






					print(modular_exponential(3   ,				200   ,				13					)					)


if __name__ == "__main__":
				import doctest

				doctest.testmod()

				main()


