#include #include using namespace std; int main(void) { string S; cin >> S; int k1 = 0, k2 = k1; while('0' <= S[k2] && S[k2] <= '9' ) k2++; int ans = stoi(S.substr(k1, k2)); k1 = k2; k2++; while(k1 < S.size()) { if(S[k1] == '+') { while('0' <= S[k2] && S[k2] <= '9' ) k2++; ans *= stoi(S.substr(k1+1, k2)); } else if(S[k1] == '*') { while('0' <= S[k2] && S[k2] <= '9' ) k2++; ans += stoi(S.substr(k1+1, k2)); } k1 = k2; k2++; } cout << ans << endl; return 0; }