
"""simple docstring"""

def 		UpperCAmelCase (		a_,						a_      ):





	'''simple docstring'''


	_enforce_args(a_,						a_      )
	if n == 0:
		return 0
	lowerCamelCase					:      Dict          =   float('-inf'      )
	for i in range(1,						n + 1      ):
		lowerCamelCase					:      Optional[int]          =   max(
		    a_,						prices[i - 1] + naive_cut_rod_recursive(n - i,						a_      )      )

	return max_revue
def 		UpperCAmelCase (		a_,						a_      ):





	'''simple docstring'''


	_enforce_args(a_,						a_      )
	lowerCamelCase					:      Dict          =   [float('-inf'      ) for _ in range(n + 1      )]
	return _top_down_cut_rod_recursive(a_,						a_,						a_      )
def 		UpperCAmelCase (		a_,						a_,						a_      ):





	'''simple docstring'''


	if max_rev[n] >= 0:
		return max_rev[n]
	elif n == 0:
		return 0
	else:
		lowerCamelCase					:      Union[str, Any]          =   float('-inf'      )
		for i in range(1,						n + 1      ):
			lowerCamelCase					:      Union[str, Any]          =   max(
			    a_,						prices[i - 1] + _top_down_cut_rod_recursive(n - i,						a_,						a_      ),						)

		lowerCamelCase					:      List[Any]          =   max_revenue

	return max_rev[n]
def 		UpperCAmelCase (		a_,						a_      ):





	'''simple docstring'''


	_enforce_args(a_,						a_      )

	# length(max_rev) = n + 1, to accommodate for the revenue obtainable from a rod of
	# length 0.
	lowerCamelCase					:      List[str]          =   [float('-inf'      ) for _ in range(n + 1      )]
	lowerCamelCase					:      Optional[int]          =   0

	for i in range(1,						n + 1      ):
		lowerCamelCase					:      List[Any]          =   max_rev[i]
		for j in range(1,						i + 1      ):
			lowerCamelCase					:      Optional[Any]          =   max(a_,						prices[j - 1] + max_rev[i - j]      )

		lowerCamelCase					:      str          =   max_revenue_i

	return max_rev[n]
def 		UpperCAmelCase (		a_,						a_      ):





	'''simple docstring'''


	if n < 0:
		lowerCamelCase					:      Optional[int]          =   F"""n must be greater than or equal to 0. Got n = {n}"""
		raise ValueError(a_      )

	if n > len(a_      ):
		lowerCamelCase					:      str          =   (
		    'Each integral piece of rod must have a corresponding price. '
		    F"""Got n = {n} but length of prices = {len(a_      )}"""
		)
		raise ValueError(a_      )
def 		UpperCAmelCase (		):





	'''simple docstring'''


	lowerCamelCase					:      Union[str, Any]          =   [6, 10, 12, 15, 20, 23]
	lowerCamelCase					:      Optional[Any]          =   len(a_      )

	# the best revenue comes from cutting the rod into 6 pieces, each
	# of length 1 resulting in a revenue of 6 * 6 = 36.
	lowerCamelCase					:      List[Any]          =   36

	lowerCamelCase					:      List[Any]          =   top_down_cut_rod(a_,						a_      )
	lowerCamelCase					:      List[str]          =   bottom_up_cut_rod(a_,						a_      )
	lowerCamelCase					:      Dict          =   naive_cut_rod_recursive(a_,						a_      )

	assert expected_max_revenue == max_rev_top_down
	assert max_rev_top_down == max_rev_bottom_up
	assert max_rev_bottom_up == max_rev_naive


if __name__ == "__main__":
					main()








"""simple docstring"""

def 		UpperCAmelCase (		a_      ):





		'''simple docstring'''


		lowerCamelCase					:      List[Any]          =   1
		for i in range(1,						num + 1      ):
				fact *= i
		return fact
def 		UpperCAmelCase (		a_      ):





		'''simple docstring'''


		lowerCamelCase					:      Optional[Any]          =   0
		while number > 0:
				lowerCamelCase					:      str          =   number % 10
				sum_of_digits += last_digit
				lowerCamelCase					:      Tuple          =   number // 10  # Removing the last_digit from the given number
		return sum_of_digits
def 		UpperCAmelCase (		a_ = 100      ):





		'''simple docstring'''


		lowerCamelCase					:      Optional[Any]          =   factorial(a_      )
		lowerCamelCase					:      int          =   split_and_add(a_      )
		return result


if __name__ == "__main__":
					print(solution(int(input('Enter the Number: ').strip())))






