#include #include #include #include #define LL long long using namespace std; int n,f,t1,t2,i,power[300],ch[40]; LL x,sum[40];string a; LL mi(LL x,LL k){ LL s=1; while(k){ if(k&1)s=(s*x); x=(x*x);k>>=1; } return s; } inline void pop(char fh){ t1--;t2--; if(fh=='+')sum[t1]+=sum[t1+1]; if(fh=='-')sum[t1]-=sum[t1+1]; if(fh=='*')sum[t1]*=sum[t1+1]; if(fh=='/')sum[t1]/=sum[t1+1]; if(fh=='^')sum[t1]=mi(sum[t1],sum[t1+1]); } int main(){ cin>>a;a='('+a+')';n=a.size(); power['(']=0;power['+']=power['-']=1;power['*']=power['/']=2;power['^']=3; while(i