num=list(map(int,input().split(',')))
def hz(nums)->int:
n=len(nums)
# if n==1:
# return nums[0]
dp=[0]*n
dp[0]=nums[0]
for i in range(1,n):
dp[i]=max(dp[i-1]+nums[i],nums[i])
x=max(dp)
if x>0:
return x
else:
return 0
print(hz(num))


京公网安备 11010502036488号