#include using namespace std; char op = 0; int acc = 0; int cur = 0, pos = 0; string s; void red() { switch(op){ case 0: acc =cur;break; case '+': acc += cur;break; case '*': acc *= cur; } cur=0; } int main(){ cin >> s; while (pos < s.length()) { if (s[pos] =='+') { red(); op = '+'; } else if (s[pos] == '*') { red(); op = '*'; } else { cur *= 10; cur += s[pos] -'0'; } pos++; } red(); cout << acc << endl; }