#include #define REP(i,n) for(int i = 0; i < (int)(n); ++i) using namespace std; int main(){ string S; cin >> S; vector N; vector M; string temp = ""; REP(i,S.size()){ if(S[i]=='+'){ N.push_back(stoi(temp)); M.push_back("a"); temp = ""; }else if(S[i]=='*'){ N.push_back(stoi(temp)); M.push_back("b"); temp = ""; } else{ temp += S[i]; } } N.push_back(stoi(temp)); int ans = N[0]; REP(i,M.size()){ if(M[i]=="a"){ ans *= N[i+1]; }else{ ans += N[i+1]; } } cout << ans << endl; return 0; }