#include<cstdio>
#include<iostream>
#include<string>
#include<queue>
#include<stack>
#include<map>
using namespace std;
struct node
{
double num;
char op;
bool flag;
};
queue<node>q;
stack<node>s;
string str;
map<char,int>op;
void change()
{
node temp;
for (int i=0;i<str.size();)
{
if(str[i]>='0'&&str[i]<='9')
{
temp.flag=true;
temp.num=0;
while(i<str.length()&&str[i]>='0'&&str[i]<='9')
{
temp.num=temp.num*10+(str[i]-'0');
i++;
}
q.push(temp);
}
else
{
temp.flag=false;
while(!s.empty()&&op[str[i]]<=op[s.top().op])
{
q.push(s.top());
s.pop();
}
temp.op=str[i];
s.push(temp);
i++;
}
}
while(!s.empty())
{
q.push(s.top());
s.pop();
}
}
double ans()
{
double temp1,temp2;
node cur;
while(!q.empty())
{
cur=q.front();
q.pop();
if(cur.flag==true)
{
s.push(cur);
}
else
{
temp1=s.top().num;
s.pop();
temp2=s.top().num;
s.pop();
if(cur.op=='+')temp1+=temp2;
else if(cur.op=='-')temp1=temp2-temp1;
else if(cur.op=='*')temp1=1.0*temp1*temp2;
else temp1=1.0*temp2/temp1;
cur.flag=true;
cur.num=temp1;
s.push(cur);
}
}
return s.top().num;
}
int main()
{
op['+']=op['-']=1;
op['*']=op['/']=2;
getline(cin,str);
change();
printf("%lf",ans());
}