Problems

# AFA Function

# AFA Function

Given a sequence of n integers. By definition, AFA(i, j) is the sum of all elements of the specified sequence between the indices i and j, inclusive, for 0 ≤ i ≤ j < n. Find the minimum of the function.

## Input data

The inputs are two lines: the first contains the number N (1 ≤ N ≤ 2000), the second - a sequence of N numbers. The value of any element of a sequence to the module does not exceed 100. The numbers are separated by spaces.

## Output data

Bring minimum of AFA.

## Examples

Input example #1

2 1 5

Output example #1

1