AT_past202306_m 点の距離
Description
There are $ N $ points on a number line, numbered from $ 1 $ to $ N $ . The $ N $ points satisfy the following condition:
- The distance between point $ i $ and point $ i+1 $ is $ d_i $ . $ (1 \leq i \leq N - 1) $
Find the minimum possible distance between point $ 1 $ and point $ N $ .
Input Format
The input is given from Standard Input in the following format:
> $ N $ $ d_1 $ $ d_2 $ $ \dots $ $ d_{N-1} $
Output Format
Print the answer.
Explanation/Hint
### Sample Explanation 1
Let $ x_i $ be the coordinate of the point $ i $ . For example, $ (x_1,x_2,x_3,x_4)=(0,-5,-3,1) $ satisfies the condition, and in this case, the distance between point $ 1 $ and point $ 4 $ is $ 1 $ .
### Constraints
- $ 2 \leq N \leq 1000 $
- $ 1 \leq d_i \leq 2000 $
- All input values are integers.