#include <iostream>
#include <string>
#include <stack>
//#define fin cin
//#define fo
using namespace std;
bool isOperator(char x)
{
if(x=='('||x==')'||x=='+'||x=='-'||x=='*'||x=='/')
return true;
else
return false;
}
int getPriority(char x)
{
if(x=='+'||x=='-')
return 1;
if(x=='*'||x=='/')
return 2;
if(x=='(')
return 0;
}
bool isBracket(char x)
{
if(x=='('||x==')')
return true;
else
return false;
}
int doOperate(int d1,int d2,char t)
{
//cout<<d1<<" "<<t<<" "<<d2<<endl;
if(t=='+')
return (d1+d2);
if(t=='-')
return (d1-d2);
if(t=='*')
return (d1*d2);
if(t=='/')
return (d1/d2);
}
int main()
{
stack<int> Q;
stack<char> S;
string str;
cin>>str;
char x;
int opnum;
string temp="";//临时存放操作数
int d