#include using namespace std; int main(){ string s;cin>>s; char prev = '-'; int previ = 0; int nwi = 0; for(int i = 0; s.size() > i; i++){ if(s[i] == '+' || s[i] == '*'){ if(prev != '-'){ if(prev == '+'){ previ *= nwi; }else{ previ += nwi; } }else{ previ = nwi; } prev = s[i]; nwi = 0; }else{ nwi= nwi*10+s[i]-'0'; } } if(prev == '+'){ cout << previ+nwi << endl; }else{ cout << previ*nwi << endl; } }