#include #include #include using namespace std; int main() { string exprs; cin >> exprs; auto p = 0, ans = 0, op = -1; while (p < exprs.size()) { if (isdigit(exprs[p])) { int num = 0; while (isdigit(exprs[p])) { num = num * 10 + exprs[p++] - '0'; } if (op < 0) ans = num; else if (op == '+') { ans = ans * num; } else if (op == '*') { ans = ans + num; } else { throw "unknown op"; } } else { op = exprs[p++]; } } cout << ans << endl; return 0; }