#include #include using namespace std; int main(){ string s;cin>>s; stack nya; int nw = 1; bool num = false; char ke = 'e'; for(int i = 0; s.size() > i; i++){ if(!num && s[i] == '+')continue; else if(!num && s[i] == '-')nw *= -1; else if(!num)nw *= s[i]-'0',num = true; else if('0' <= s[i] && s[i] <= '9')nw = nw*10+s[i]-'0'; else{ nya.push(nw); num = false; nw = 1; if(s[i] == '+')ke = '-'; else ke = '+'; } } cout << nya.top()+(ke=='+'?nw:-nw) << endl; }