



def A						(       __UpperCamelCase					)						->      int:
			A__       =    abs(__UpperCamelCase					)
			A__       =    0
			while n > 0:
						res += n % 10
						n //= 10
			return res


def A						(       __UpperCamelCase					)						->      int:
			A__       =    abs(__UpperCamelCase					)
			return n if n < 10 else n % 10 + sum_of_digits(n // 10					)


def A						(       __UpperCamelCase					)						->      int:
			return sum(int(__UpperCamelCase					) for c in str(abs(__UpperCamelCase					)					)					)


def A						(       )						->      None:
			from collections.abc import Callable
			from timeit import timeit

			def benchmark_a_function(__UpperCamelCase ,	__UpperCamelCase					) -> None:
						A__       =    f'''{func.__name__}({value})'''
						A__       =    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 random


def A						(       __UpperCamelCase ,	__UpperCamelCase = False					)						->      float:
			if deriv:
						return value * (1 - value)
			return 1 / (1 + math.exp(-value					))


# Initial Value
SCREAMING_SNAKE_CASE__       =      0.02


def A						(       __UpperCamelCase ,	__UpperCamelCase					)						->      float:
			A__       =    float(2 * (random.randint(1 ,	100					)) - 1					)

			for _ in range(__UpperCamelCase					):
						# Forward propagation
						A__       =    sigmoid_function(INITIAL_VALUE * weight					)
						# How much did we miss?
						A__       =    (expected / 100) - layer_a
						# Error delta
						A__       =    layer_1_error * sigmoid_function(__UpperCamelCase ,	__UpperCamelCase					)
						# Update weight
						weight += INITIAL_VALUE * layer_1_delta

			return layer_a * 100


if __name__ == "__main__":
							import doctest

							doctest.testmod()

							SCREAMING_SNAKE_CASE__       =      int(input('''Expected value: '''))
							SCREAMING_SNAKE_CASE__       =      int(input('''Number of propagations: '''))
							print(forward_propagation(expected, number_propagations))




