#include <bits/stdc++.h>
using namespace std;
int main() {
stack<double> t1;
char ch;
int tot=0;
double sum=0,x;
cin>>ch;
while(ch!='#'){
if(ch>='0'&& ch<='9'){
x=0;
while (ch>='0'&&ch<='9'){
x=x*10+ch-'0';
ch=getchar();
}
t1.push(x);
}else {
int a,b;
b=t1.top();
t1.pop();
a=t1.top();
t1.pop();
switch(ch){
case '+':{
sum=a+b;
break;
}
case '-':{
sum=a-b;
break;
}
case '*':{
sum=a*b;
break;
}
case '/':{
sum=a/b;
break;
}
}
t1.push(sum);
}
cin>>ch;
}
cout<<t1.top();
return 0;
}