#include using namespace std; typedef long long ll; typedef string str; int main() { str s; cin >> s; stringstream ss(s); ll n; char o; vector st; ss >> n; st.push_back(n); while (ss >> o >> n) { if (o == '*') { ll t = st.back(); st.pop_back(); st.push_back(t * n); } else if (o == '+') st.push_back(n); } ll ans = 0; for (ll x : st) ans += x; cout << ans; return 0; }