"""simple docstring"""






from collections.abc import Sequence




def 						SCREAMING_SNAKE_CASE					(  __UpperCAmelCase = None       )							->   int:
				if nums is None or not nums:
								raise ValueError("Input sequence should not be empty"       )

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

				return ans


if __name__ == "__main__":
						import doctest

						doctest.testmod()

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





"""simple docstring"""






def 						SCREAMING_SNAKE_CASE					(  __UpperCAmelCase       )							->   int:

				if not isinstance(__UpperCAmelCase  ,					__UpperCAmelCase       ):
								raise ValueError("multiplicative_persistence() only accepts integral values"       )
				if num < 0:
								raise ValueError("multiplicative_persistence() does not accept negative values"       )

				SCREAMING_SNAKE_CASE__		  =				0
				SCREAMING_SNAKE_CASE__		  =				str(__UpperCAmelCase       )

				while len(__UpperCAmelCase       ) != 1:
								SCREAMING_SNAKE_CASE__		  =				[int(__UpperCAmelCase       ) for i in num_string]

								SCREAMING_SNAKE_CASE__		  =				1
								for i in range(0  ,					len(__UpperCAmelCase       )       ):
												total *= numbers[i]

								SCREAMING_SNAKE_CASE__		  =				str(__UpperCAmelCase       )

								steps += 1
				return steps




def 						SCREAMING_SNAKE_CASE					(  __UpperCAmelCase       )							->   int:

				if not isinstance(__UpperCAmelCase  ,					__UpperCAmelCase       ):
								raise ValueError("additive_persistence() only accepts integral values"       )
				if num < 0:
								raise ValueError("additive_persistence() does not accept negative values"       )

				SCREAMING_SNAKE_CASE__		  =				0
				SCREAMING_SNAKE_CASE__		  =				str(__UpperCAmelCase       )

				while len(__UpperCAmelCase       ) != 1:
								SCREAMING_SNAKE_CASE__		  =				[int(__UpperCAmelCase       ) for i in num_string]

								SCREAMING_SNAKE_CASE__		  =				0
								for i in range(0  ,					len(__UpperCAmelCase       )       ):
												total += numbers[i]

								SCREAMING_SNAKE_CASE__		  =				str(__UpperCAmelCase       )

								steps += 1
				return steps


if __name__ == "__main__":
						import doctest

						doctest.testmod()




