#include #include #include int main() { std::string s; std::cin >> s; int ans, pos; for (pos = 0; pos < s.length(); pos++) { if (!isdigit(s[pos])) break; } ans = std::stoi(s.substr(0, pos)); for (; pos < s.length();) { char c = s[pos]; pos++; int start = pos; for (;pos < s.length(); pos++) { if (!isdigit(s[pos])) break; } int num = std::stoi(s.substr(start, pos - start)); if (c == '*') ans += num; else ans *= num; } std::cout << ans << std::endl; return 0; }