#include <iostream>
#include <string>
#include <cstdio>
#include <stack>
using namespace std;
double GetNum(string str,int& index){
double num = 0;
while (isdigit(str[index])){
num = num * 10 + str[index]-'0';
index ++;
}
return num;
}
int Priority(char x){
if(x == '#'){
return 0;
}else if(x == '$'){
return 1;
}else if(x == '+' || x == '-'){
return 2;
}else{
return 3;
}
}
double Calculate(double a, double b,char c){
if(c == '+'){
return a+b;
}else if(c == '-'){
return a-b;
}else if(c == '*'){
return a*b;
}else{
return a/b;
}
}
int main(){
string str;
while (getline(cin,str)){
if(str =="0"){
break;
}
stack<char> opt;
stack<double> nums;
opt.push('#');
str += '$';
int i = 0;
while(i < str.size()){
if(isdigit(str[i])){
nums.push(GetNum(str,i));
}else if(str[i]==' '){
i ++;
}else{
if(Priority(opt.top()) >= Priority(str[i])){
double b = nums.top();
nums.pop();
double a = nums.top();
nums.pop();
nums.push(Calculate(a,b,opt.top()));
opt.pop();
}else{
opt.push(str[i]);
i ++;
}
}
}
printf("%.2f\n",nums.top());
}
return 0;
}