#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define INF 1000000000 #define EPS 1e-9 #define PI acos(-1) typedef long long ll; typedef pair P; #define MAX_N 1000000 #define MAX_K 1000000 string S; int main(){ cin >> S; int ans = 0; int mode = 0;//0:何もしない 1:足し算 2:掛け算 for(int i = 0; i < S.length(); i++){ string tmp; for(int j = i; j < S.length(); j++){ tmp += S[j]; if(j+1 == S.length()){ if(mode == 0) ans += atoi(tmp.c_str()); else if(mode == 1) ans += atoi(tmp.c_str()); else if(mode == 2) ans *= atoi(tmp.c_str()); mode = 0; i = j+1; break; } else if(S[j+1] == '*'){ if(mode == 0) ans = atoi(tmp.c_str()); else if(mode == 1) ans += atoi(tmp.c_str()); else if(mode == 2) ans *= atoi(tmp.c_str()); mode = 1; i = j+1; break; } else if(S[j+1] == '+'){ if(mode == 0) ans = atoi(tmp.c_str()); else if(mode == 1) ans += atoi(tmp.c_str()); else if(mode == 2) ans *= atoi(tmp.c_str()); mode = 2; i = j+1; break; } } } cout << ans << endl; return 0; }