#include <bits/stdc++.h>
using namespace std;
int n, x, ans, tg;
char c;
void getc(char& x) {
  x = getchar();
  while (x != '+' && x != '-') x = getchar();
}
int main() {
  scanf("%d", &n), scanf("%d", &ans);
  for (int i = 2; i <= n; ++i) {
    getc(c), scanf("%d", &x);
    if (c == '+' || tg)
      ans += x;
    else
      ans -= x, tg = 1;
  }
  printf("%lld", ans);
  return 0;
}
