#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <iostream>
#include <sstream>
#include <stack>
#include <functional>

#define rep(i, n) for(int i = 0; i < (n); ++i)

using namespace std;

int main(){
	string line;
	while(std::getline(cin, line)){
		stack<double> s;

		istringstream iss(line);
		string token;
		while(iss >> token){
			if(token == "+" || token == "-" || token == "*" || token == "/"){
				std::function<double(double, double)> op;
				if(token == "+"){
					op = plus<double>();
				}
				else if(token == "-"){
					op = minus<double>();
				}
				else if(token == "*"){
					op = multiplies<double>();
				}
				else{
					op = divides<double>();
				}
				double b = s.top();
				s.pop();
				double a = s.top();
				s.pop();
				s.push(op(a, b));
			}
			else{
				s.push(strtod(token.c_str(), 0));
			}
		}
		printf("%lf\n", s.top());
	}
	return 0;
}