#include <bits/stdc++.h>

using namespace std;

#define int long long
#define all(v) begin(v), end(v)
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define reps(i, s, n) for(int i = (int)(s); i < (int)(n); i++)

template<class T1, class T2> void chmin(T1 &a, T2 b){if(a>b)a=b;}
template<class T1, class T2> void chmax(T1 &a, T2 b){if(a<b)a=b;}

using pint = pair<int, int>;
using tint = tuple<int, int, int>;
using vint = vector<int>;

const int inf = 1LL << 55;
const int mod = 1e9 + 7;

signed main()
{
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(12);

  string s;
  cin >> s;
  int dp[2][202][202];
  rep(i, 202) rep(j, 202) {
    dp[0][i][j] = -inf;
    dp[1][i][j] = inf;
  }
  reps(len, 1, s.size()+1) {
    rep(i, s.size()+1-len) {
      int j = i + len;
      if(len == 1 && isdigit(s[i])) {
	dp[0][i][j] = dp[1][i][j] = s[i]-'0';
      }

      if(len < 3) continue;

      if(len > 3) { // a+<(b>?????????????????????a+<(b+c>???ok / ()???????????????????????????4??\???
	if(s[i] == '(') {
	  chmax(dp[0][i][j], dp[0][i+1][j]);
	  chmin(dp[1][i][j], dp[1][i+1][j]);
	} else if(s[j-1] == ')') { // <a)>+b <z+a)>+b
	  chmax(dp[0][i][j], dp[0][i][j-1]);
	  chmin(dp[1][i][j], dp[1][i][j-1]);
	}
      }


      reps(k, i+1, j-1) {
	if(s[k] == '+') {
	  chmax(dp[0][i][j], dp[0][i][k]+dp[0][k+1][j]);
	  chmin(dp[1][i][j], dp[1][i][k]+dp[1][k+1][j]);
	} else if(s[k] == '-') {
	  chmax(dp[0][i][j], dp[0][i][k]-dp[1][k+1][j]);
	  chmin(dp[1][i][j], dp[1][i][k]-dp[0][k+1][j]);
	}
      }
    }
  }
  //rep(i, s.size()) reps(j, i+1, s.size()+1) cout << dp[0][i][j]<<endl;
  cout << dp[0][0][s.size()] << endl;

  return 0;
}
### Prompt

Your task is to create a cpp solution to the following problem:

Tunnel formula

One day while exploring an abandoned mine, you found a long formula S written in the mine. If you like large numbers, you decide to take out the choke and add `(` or `)` so that the result of the formula calculation is as large as possible. If it has to be a mathematical formula even after adding it, how many can it be at the maximum?

There is enough space between the letters, and you can add as many `(` or `)` as you like. If the final formula is a formula, you may write `(` or `)` so that the correspondence of the first parenthesis is broken (see Sample 2). Also, here, <expr> defined by the following BNF is called a mathematical formula. All numbers in the formula are single digits.


<expr> :: = "(" <expr> ")"
| <term> "+" <term>
| <term> "-" <term>
<term> :: = <digit> | <expr>
<digit> :: = "0" | "1" | "2" | "3" | "4"
| "5" | "6" | "7" | "8" | "9"


Constraints

* 3 ≤ | S | ≤ 200



S represents a mathematical formula.

Input Format

Input is given from standard input in the following format.


S


Output Format

Output the answer as an integer.

Sample Input 1


1- (2 + 3-4 + 5)


Sample Output 1


Five


1- (2 + 3- (4 + 5)) is the maximum.

Sample Input 2


1- (2 + 3 + 4)


Sample Output 2


0


(1- (2 + 3) + 4) is the maximum.

Sample Input 3


1- (2 + 3)


Sample Output 3


-Four


Note that 1- (2) + (3) is not the formula here.





Example

Input

1-(2+3-4+5)


Output

5

### Response

```cpp
#include <bits/stdc++.h>

using namespace std;

#define int long long
#define all(v) begin(v), end(v)
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define reps(i, s, n) for(int i = (int)(s); i < (int)(n); i++)

template<class T1, class T2> void chmin(T1 &a, T2 b){if(a>b)a=b;}
template<class T1, class T2> void chmax(T1 &a, T2 b){if(a<b)a=b;}

using pint = pair<int, int>;
using tint = tuple<int, int, int>;
using vint = vector<int>;

const int inf = 1LL << 55;
const int mod = 1e9 + 7;

signed main()
{
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(12);

  string s;
  cin >> s;
  int dp[2][202][202];
  rep(i, 202) rep(j, 202) {
    dp[0][i][j] = -inf;
    dp[1][i][j] = inf;
  }
  reps(len, 1, s.size()+1) {
    rep(i, s.size()+1-len) {
      int j = i + len;
      if(len == 1 && isdigit(s[i])) {
	dp[0][i][j] = dp[1][i][j] = s[i]-'0';
      }

      if(len < 3) continue;

      if(len > 3) { // a+<(b>?????????????????????a+<(b+c>???ok / ()???????????????????????????4??\???
	if(s[i] == '(') {
	  chmax(dp[0][i][j], dp[0][i+1][j]);
	  chmin(dp[1][i][j], dp[1][i+1][j]);
	} else if(s[j-1] == ')') { // <a)>+b <z+a)>+b
	  chmax(dp[0][i][j], dp[0][i][j-1]);
	  chmin(dp[1][i][j], dp[1][i][j-1]);
	}
      }


      reps(k, i+1, j-1) {
	if(s[k] == '+') {
	  chmax(dp[0][i][j], dp[0][i][k]+dp[0][k+1][j]);
	  chmin(dp[1][i][j], dp[1][i][k]+dp[1][k+1][j]);
	} else if(s[k] == '-') {
	  chmax(dp[0][i][j], dp[0][i][k]-dp[1][k+1][j]);
	  chmin(dp[1][i][j], dp[1][i][k]-dp[0][k+1][j]);
	}
      }
    }
  }
  //rep(i, s.size()) reps(j, i+1, s.size()+1) cout << dp[0][i][j]<<endl;
  cout << dp[0][0][s.size()] << endl;

  return 0;
}
```