

from __future__ import annotations
def 						_snake_case(   SCREAMING_SNAKE_CASE__      :     Optional[Any]   ,      SCREAMING_SNAKE_CASE__      :     List[Any]   ,      SCREAMING_SNAKE_CASE__      :     Optional[int]   ,      SCREAMING_SNAKE_CASE__      :     List[str]				)							->				int:  # noqa: E741





    '''simple docstring'''






    while r - l > 1:
        A__   				=       (l + r) // 2
        if v[m] >= key:
            A__   				=       m
        else:
            A__   				=       m  # noqa: E741
    return r
def 						_snake_case(   SCREAMING_SNAKE_CASE__      :     list[int]				)							->				int:





    '''simple docstring'''






    if len(SCREAMING_SNAKE_CASE__				) == 0:
        return 0

    A__   				=       [0] * len(SCREAMING_SNAKE_CASE__				)
    A__   				=       1

    A__   				=       v[0]

    for i in range(1   ,      len(SCREAMING_SNAKE_CASE__				)				):
        if v[i] < tail[0]:
            A__   				=       v[i]
        elif v[i] > tail[length - 1]:
            A__   				=       v[i]
            length += 1
        else:
            A__   				=       v[i]

    return length


if __name__ == "__main__":
     import doctest

     doctest.testmod()




from collections.abc import Sequence
def 						_snake_case(   SCREAMING_SNAKE_CASE__      :     Sequence[int] | None = None				)							->				int:





    '''simple docstring'''






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

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

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

