#include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); string S; cin >> S; deque num, op; for (int i = 0; i < (int)S.size(); i++) { if (S[i] == '*' || S[i] == '+') { op.push_back(S[i]); } else { int n = 0; while (i < (int)S.size() && (S[i] != '*' && S[i] != '+')) { n *= 10; n += S[i] - '0'; i++; } i--; num.push_back(n); } } while (!num.empty() && !op.empty()) { int a = num.front(); num.pop_front(); int b = num.front(); num.pop_front(); char c = op.front(); op.pop_front(); num.push_front(c == '*' ? a + b : a * b); } cout << num.front() << '\n'; return 0; }