Developed in the beginning of XXI century, hyperjump remains the primary method of transportation for distances up to thousands parsecs. But physicists have recently discovered an amazing phenomenon. They believe the duration of the hyperjump alpha phase can be easily controlled. Alpha phase is the period when hyperspacecraft accumulates its gravity potential. The larger is the gravity potential accumulated, the less energy is required to complete the hyperjump.
Your task is to write a program, which would help pilots decide when to enter and when to leave the alphaphase, in order for the hyperspacecraft to accumulate the largest possible gravity potential.
The most crude gravity field model (which you will have to use) yields the sequence of integers p_{i}, which represent field intensities at different moments in time. According to this model, if the alphaphase begins at moment i and ends at moment j, then the value of gravity potential accumulated will be equal to the sum of sequence elements at places from ith to jth inclusive.
Input
The first line of the input contains an integer N being the number of elements in the intensity values sequence (0 ≤ N ≤ 60000). Next N lines specify sequence elements, each line containing a single integer p_{i} (−30000 ≤ p_{i} ≤ 30000).
Output
Output the largest possible value of the gravity potential that can be accumulated by a hyperspacecraft during the alpha phase. You should assume that the initial gravity potential of a hyperspacecraft is equal to zero.
Samples
input  output 

10
31
41
59
26
53
58
97
93
23
84
 187

3
1
5
6
 0

Problem Author: Den Raskovalov
Problem Source: IX Open Collegiate Programming Contest of the High School Pupils (13.03.2004)