Profit#2585

Profit

1 segundo
128 megabytes
Muy fácil

The cows have opened a new business, and Farmer John wants to see how well they are doing. The business operates for (1 \leq n \leq 10^5) days, and on each -th day, the cows record their net profit P_i (-1000 \leq P_i \leq 1000).

Farmer John wants to find the maximum profit that the cows have obtained during any consecutive period of time (note that a consecutive period can have a length from one day to days). Help him by writing a program to find the value of the maximum profit obtained for any consecutive period.

Entrada

The first line contains an integer . Each of the next lines contains one integer P_i.

Salida

Print the value of the maximum profit obtained during any consecutive period.

Ejemplos

Ejemplo 1

Loading
Loading