Pretty#10957

Pretty

0.4 seconds
256 megabytes
Easy

In a given array of numbers, your task is to find a subarray with the largest possible sum. The subarray must contain at least one element.

Input

The first line contains one integer (1 \leq n \leq 10^5), representing the number of elements in the array.

The second line contains integers a_1, a_2, \ldots, a_n (-10^4 \leq a_i \leq 10^4), representing the elements of the array.

Output

Print one integer, representing the largest possible sum of a subarray.

Examples

Example

Input
5
-2 1 -3 4 -1 2 1 -5 4
Output
6

Example 1

Loading
Loading

Example 2

Loading
Loading

Note

In the given example, the subarray with the largest sum is [4, -1, 2, 1], whose sum equals .