#include #include #include using namespace std; int main() { stack st; string s; while (cin >> s) { if (s == "push") { int broj; cin >> broj; st.push(broj); } else if (s == "add") { int op1 = st.top(); st.pop(); int op2 = st.top(); st.pop(); st.push(op1 + op2); } else if (s == "mul") { int op1 = st.top(); st.pop(); int op2 = st.top(); st.pop(); st.push(op1 * op2); } else { // greska } } cout << st.top() << endl; return 0; }