#include <iostream>
#include <queue>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <cctype>

using namespace std;

#define REP(i,n) for(ll (i) = (0); (i) < (n); ++i)
#define PB push_back
#define MP make_pair
#define FI first
#define SE second
#define ALL(v) v.begin(),v.end()
#define Decimal fixed << setprecision(20)
#define SHOWP(x) cerr<<"["<<(x).FI<<", "<<(x).SE<<"]";
#define SHOWX(x) cerr<<#x<<": "<<x<<endl;
#define SHOWVEC(v, e) REP(i, e) cerr << (v[i]) << ' '; cerr << endl;
#define SHOW2D(a, h, w) REP(i, h){REP(j, w)cerr<<setw(3)<<(a[i][j])<<' ';cerr<<endl;}
constexpr int INF = 1 << 30 - 1;
constexpr long long LLINF = 1LL << 60;
constexpr long long MOD = 1000000007;

typedef long long ll;
typedef pair<ll, ll> P;

using State = string::const_iterator;

int expr(State &s);
int term(State &s);
int factor(State &s);
int number(State &s);

int number(State &s)
{
  int ret = 0;
  while (isdigit(*s)) {
    ret *= 10;
    ret += *s - '0';
    s++;
  }
  return ret;
}

int factor(State &s)
{
  int ret;
  if (*s == '(') {
    s++;
    ret = expr(s);
    s++;
  } else {
    ret = number(s);
  }
  return ret;
}

int term(State &s)
{
  int ret = factor(s);
  while (1) {
    if (*s == '(') ret *= factor(s);
    else break;
  }
  return ret;
}

int expr(State &s)
{
  int ret = term(s);
  while (1) {
    if (*s == '+') {
      s++;
      ret += term(s);
    } else if (*s == '-') {
      s++;
      ret -= term(s);
    } else {
      break;
    }
  }
  return ret;
}

int main()
{
  string S;
  cin >> S;

  State begin = S.begin();
  cout << expr(begin) << endl;

  return 0;
}