#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define popcount __builtin_popcount using namespace std; typedef long long int ll; typedef pair P; int main() { int n; cin>>n; vector v; for(int i=0; i>a; if(a=="+"){ int y=v.back(); v.pop_back(); int x=v.back(); v.pop_back(); v.push_back(x+y); }else if(a=="-"){ int y=v.back(); v.pop_back(); int x=v.back(); v.pop_back(); v.push_back(x-y); }else{ int x=0; for(int j=0; j