#### Registered Users Only

Please login to utilize this feature.

Do note that this website only supports submissions in C++.

### addsubtract

### Problem Statement

Joisino has a formula consisting of `N` terms: `A _{1}`

`op`

_{1}`A`

_{2}`...`

`op`

_{N-1}`A`. Here,

_{N}`A`is an integer, and

_{i}`op`is an binary operator either

_{i}`+`

or `-`

.
Because Joisino loves large numbers, she wants to maximize the evaluated value of the formula by inserting an arbitrary number of pairs of parentheses (possibly zero) into the formula.
Opening parentheses can only be inserted immediately before an integer, and closing parentheses can only be inserted immediately after an integer.
It is allowed to insert any number of parentheses at a position.
Your task is to write a program to find the maximum possible evaluated value of the formula after inserting an arbitrary number of pairs of parentheses.### Constraints

`1≦N≦10`^{5}`1≦A`_{i}≦10^{9}`op`is either_{i}`+`

or`-`

.

### Input

The input is given from Standard Input in the following format:

NA_{1}op_{1}A_{2}...op_{N-1}A_{N}

### Output

Print the maximum possible evaluated value of the formula after inserting an arbitrary number of pairs of parentheses.

### Sample Input 1

3 5 - 1 - 3

### Sample Output 1

7

The maximum possible value is: `5 - (1 - 3) = 7`.

### Sample Input 2

5 1 - 2 + 3 - 4 + 5

### Sample Output 2

5

The maximum possible value is: `1 - (2 + 3 - 4) + 5 = 5`.

### Sample Input 3

5 1 - 20 - 13 + 14 - 5

### Sample Output 3

13

The maximum possible value is: `1 - (20 - (13 + 14) - 5) = 13`.

### Tags

### Subtasks and Limits

Subtask | Score | #TC | Time | Memory | Scoring |
---|---|---|---|---|---|

1 | 100 | 29 | 1s | 256MB | Minimum |

2 | 0 | 3 | 1s | 256MB | Minimum |

### Judge Compile Command

g++-8 ans.cpp -o addsubtract -Wall -Wshadow -static -O2 -lm -m64 -s -w -std=gnu++17 -fmax-errors=512