#include <bits/stdc++.h>
const long long mod = 1e9 + 7;
const long long maxn = 100050;
using namespace std;
long long n;
long long a[maxn];
char op[maxn];
long long solve(long long pos) {
  if (pos == n) return a[pos];
  long long tmp = 0;
  if (op[pos] == '+')
    tmp = 1;
  else
    tmp = 2;
  if (tmp == 1)
    return a[pos] + solve(pos + 1);
  else
    return a[pos] - solve(pos + 1);
}
int main() {
  ios::sync_with_stdio(0);
  cin >> n;
  for (long long i = 1; i <= n; i++) {
    if (i != n)
      cin >> a[i] >> op[i];
    else
      cin >> a[i];
  }
  cout << solve(1) << endl;
}
