#include using namespace std; int main() { string S; cin >> S; int ans = 0, tmp = 0, opr = 0; auto calc = [&]() { if (opr) ans *= tmp; else ans += tmp; tmp = 0; }; for (auto& c : S) { if (c == '*') { calc(); opr = 0; } else if (c == '+') { calc(); opr = 1; } else { tmp = tmp * 10 + (c - '0'); } } calc(); cout << ans << endl; }