from __future__ import annotations

import sys


def 					__lowerCAmelCase			(  _A					):



							"""simple docstring"""


							if n < 0:
														raise ValueError("""Negative arguments are not supported"""					)
							return _fib(_A					)[0]


def 					__lowerCAmelCase			(  _A					):



							"""simple docstring"""


							if n == 0:  # (F(0), F(1))
														return (0, 1)

							# F(2n) = F(n)[2F(n+1) − F(n)]
							# F(2n+1) = F(n+1)^2+F(n)^2
							_lowercase				,       _lowercase				=	_fib(n // 2					)
							_lowercase				=	a * (b * 2 - a)
							_lowercase				=	a * a + b * b
							return (d, c + d) if n % 2 else (c, d)


if __name__ == "__main__":
				A_:      Union[str, Any]        =			int(sys.argv[1])
				print(F'''fibonacci({n}) is {fibonacci(n)}''')



import math
from timeit import timeit


def 					__lowerCAmelCase			(  _A					):



							"""simple docstring"""


							_lowercase				=	0
							_lowercase				=	abs(_A					)
							while True:
														_lowercase				=	n // 10
														digits += 1
														if n == 0:
																					break
							return digits


def 					__lowerCAmelCase			(  _A					):



							"""simple docstring"""


							return 1 if n == 0 else math.floor(math.log(abs(_A					) ,10					) + 1					)


def 					__lowerCAmelCase			(  _A					):



							"""simple docstring"""


							return len(str(abs(_A					)					)					)


def 					__lowerCAmelCase			(  ):



							"""simple docstring"""


							from collections.abc import Callable

							def benchmark_a_function(_A ,_A					) -> None:
														_lowercase				=	f'''{func.__name__}({value})'''
														_lowercase				=	timeit(f'''__main__.{call}''' ,setup="""import __main__"""					)
														print(f'''{call}: {func(_A					)} -- {timing} 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 (num_digits, num_digits_fast, num_digits_faster):
																					benchmark_a_function(_A ,_A					)
														print()


if __name__ == "__main__":
				import doctest

				doctest.testmod()
				benchmark()


