


def       a_ (       SCREAMING_SNAKE_CASE__   : int	):
       '''simple docstring'''





       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'	)

       _lowerCamelCase			:						str            =0
       _lowerCamelCase			:						Optional[int]            =str(UpperCAmelCase_	)

       while len(UpperCAmelCase_	) != 1:
              _lowerCamelCase			:						Optional[int]            =[int(UpperCAmelCase_	) for i in num_string]

              _lowerCamelCase			:						Tuple            =1
              for i in range(0						,     len(UpperCAmelCase_	)	):
                     total *= numbers[i]

              _lowerCamelCase			:						Union[str, Any]            =str(UpperCAmelCase_	)

              steps += 1
       return steps




def       a_ (       SCREAMING_SNAKE_CASE__   : int	):
       '''simple docstring'''





       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'	)

       _lowerCamelCase			:						Any            =0
       _lowerCamelCase			:						List[Any]            =str(UpperCAmelCase_	)

       while len(UpperCAmelCase_	) != 1:
              _lowerCamelCase			:						List[Any]            =[int(UpperCAmelCase_	) for i in num_string]

              _lowerCamelCase			:						Union[str, Any]            =0
              for i in range(0						,     len(UpperCAmelCase_	)	):
                     total += numbers[i]

              _lowerCamelCase			:						List[Any]            =str(UpperCAmelCase_	)

              steps += 1
       return steps


if __name__ == "__main__":
 import doctest

 doctest.testmod()




from collections.abc import Sequence
def 							SCREAMING_SNAKE_CASE_	(					UpperCAmelCase_	:     Sequence[int] | None = None				)			->						int:
       if nums is None or not nums:
              raise ValueError('''Input sequence should not be empty'''				)

       SCREAMING_SNAKE_CASE_							:				Tuple		=nums[0]
       for i in range(1			,							len(UpperCAmelCase_				)				):
              SCREAMING_SNAKE_CASE_							:				Any		=nums[i]
              SCREAMING_SNAKE_CASE_							:				Optional[int]		=max(UpperCAmelCase_			,							ans + num			,							UpperCAmelCase_				)

       return ans


if __name__ == "__main__":
 import doctest

 doctest.testmod()

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