题目描述
PIET's CS department has been continuously organizing mock placement drives for students. If a student under-performs negative point is rewarded otherwise positive points is rewarded. The HOD wants to find consistency of a student. So, he wants to find out maximum consistent sum of a student score only if his/her overall rating is positive.
Help HOD in doing so.
Input
The first line contain number of drives N over which the analysis is to be done. The second line contains score of student in those N drives.
Output
Print a single integer i.e. the maximum consistent score of the student if it is positive otherwise output 0 (zero).
SAMPLE INPUT
8
-1 -4 4 -2 0 1 4 -5
SAMPLE OUTPUT
7
输入格式
见题面
输出格式
见题面
样例输入
8
-1 -2 5 -1 -2 3 2 -1
样例输出
4453