import ast class Solution(object):
def maxSubArray(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
for i in range(1, len(nums)):#range使用方法:range(start,stop[,step])
nums[i]= nums[i] + max(nums[i-1], 0)
return max(nums)
obj = ast.literal_eval(input()) use1 = Solution() print(use1.maxSubArray(obj))