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