Given a sequence of integers. By definition, \text{AFA}(i, j) is the sum of all elements of the specified sequence between the indices and , inclusive, for 0 \le i \le j < n. Find the minimum of the function.
The inputs are two lines: the first contains the number (1 \le N \le 2000), the second - a sequence of numbers. The absolute value of any element of the sequence does not exceed . The numbers are separated by spaces.
Output the minimum of .
Example 1