#include #define rep(i, n) for(long long i = 0; i < n; i++) #define ALL(v) (v).begin(), (v).end() #define rALL(v) (v).rbegin(), (v).rend() using namespace std; using lint = long long; int main() { string s; cin >> s; vector a; vector b = {'.'}; string now = ""; rep(i, (int)s.size()) { if (s[i] == '*' || s[i] == '+') { a.emplace_back(stoi(now)); now = ""; b.emplace_back(s[i]); } else { now += s[i]; } } a.emplace_back(stoi(now)); int ans = a[0]; for (int i = 1; i < (int)a.size(); i++) { if (b[i] == '*') { ans += a[i]; } else { ans *= a[i]; } } cout << ans << endl; }