#include <iostream>
#include <stack>
#include <string>
#include <cstdlib>
#include <cstdio>
using namespace std;
char ch[100];
string str;
int main(){
	stack<double> std;
	int i,c,j,size;
	bool flag = false;
	double a,b;
	while(getline(cin,str)){
		c = 0;
		size = str.size();
		if(str[size - 1] != '+' && str[size - 1] != '-' && str[size - 1] != '/' && str[size - 1] != '*'){
			for(i = 0;i < size;i++){
				ch[c] = str[i];
				c++;
			}
			std.push(atof(ch));
			c = 0;
		}
		else {
			for(i = 0;i < size;i++){
				if(str[i] != ' ' && str[i] != '\0'){
					if(str[i] == '+'){
						a = std.top();
						std.pop();
						b = std.top();
						std.pop();
						std.push(a+b);
						flag = true;
					}
					else if(str[i] == '/'){
						a = std.top();
						std.pop();
						b = std.top();
						std.pop();
						std.push(b/a);
						flag = true;
					}
					else if(str[i] == '*'){
						a = std.top();
						std.pop();
						b = std.top();
						std.pop();
						std.push(a*b);
						flag = true;
					}
					else if(str[i] == '-'){
						if(str[i+1] == ' ' || str[i+1] == '\0'){
							a = std.top();
							std.pop();
							b = std.top();
							std.pop();
							std.push(b-(a));
							flag = true;
						}
						else{
							ch[c] = str[i];
							c++;
							flag = false;
						}
					}
					else{
						ch[c] = str[i];
						c++;
						flag = false;
					}
				}
				else {
					if(i+1 < size){
						if(!flag) std.push(atof(ch));
						for(j = 0;j < c;j++) ch[j] = '\0';
						c = 0;
					}
				}

			}
		}
		printf("%.6f\n",std.top());
		std.pop();
	}
	return 0;
}