#include #include void solve() { std::string s; std::cin >> s; s.push_back('$'); int ans = 0, x = 0; char prev = '*'; for (char c : s) { if (std::isdigit(c)) { x = x * 10 + c - '0'; } else { if (prev == '*') { ans += x; } else { ans *= x; } prev = c; x = 0; } } std::cout << ans << std::endl; } int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); solve(); return 0; }