#include #define FOR(i,a,b) for(int i=(a);i<(b);i++) #define REP(i,b) FOR(i,0,b) #define X real() #define Y imag() #define S second; #define F first; #define PB(a) push_back(a) #define BE(c) c.begin(),c.end() using namespace std; typedef long long LL; typedef pair pr; typedef pair ppr; typedef priority_queue,greater > PQ; typedef vector Vpr; typedef vector VI; typedef complex cld; typedef vector Vcld; const int SIZE=1000010; const LL INF=1<<30; int main(){ string s; int now=0,type=1,pm=1,ans=0; cin >> s; while(now!=s.size()){ if(type==1){ if(s[now]=='-') pm*=-1; else pm*=1; if(s[now]!='-' && s[now]!='+') type++; } if(type==2){ long long x=0; while('0'<=s[now] && s[now]<='9'){ x*=10; x+=s[now]-'0'; now++; } now--; ans+=pm*x; } else if(type==0){ if(s[now]=='-') pm=1; else pm=-1; } now++; type++; type%=3; } cout << ans << endl; return 0; }