


'''simple docstring'''






from collections.abc import Sequence


def  _snake_case       (					A = None	)						->   Optional[int]:



							if nums is None or not nums:
														raise ValueError('''Input sequence should not be empty'''	)

							lowerCAmelCase__	       =     nums[0]
							for i in range(1			,   len(A__	)	):
														lowerCAmelCase__	       =     nums[i]
														lowerCAmelCase__	       =     max(A__			,   ans + num			,   A__	)

							return ans


if __name__ == "__main__":
		import doctest

		doctest.testmod()

		# Try on a sample input from the user
		__UpperCAmelCase       =							int(input('''Enter number of elements : ''').strip())
		__UpperCAmelCase       =							list(map(int, input('''\nEnter the numbers : ''').strip().split()))[:n]
		print(max_subsequence_sum(array))



'''simple docstring'''






def  _snake_case       (					A = 10			,   A = 22	)						->   int:
							lowerCAmelCase__	       =     range(1			,   A	)
							lowerCAmelCase__	       =     range(1			,   A	)
							return sum(
							    1 for power in powers for base in bases if len(str(base**power	)	) == power	)


if __name__ == "__main__":
		print(f"""{solution(10, 22) = }""")