#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <sstream>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <numeric>
#include <cmath>
#include <climits>
#include <limits>
#include <cfloat>
#include <fstream>
using namespace std;

double stod (string s )
{
	stringstream ss (s);
	double res;
	ss >> res;

	return res;
}

int main()
{
//	cut here before submit 
//	freopen("testcase.sme", "r", stdin);
	string str = "";

	while (getline (cin, str ) ){
		vector <string> exp;
		stringstream ss(str);
		string s = "";

		while (ss >> s){
			exp.push_back(s);
		} // end if
	
		stack<double> S;
		int size = exp.size();
		double res = 0.0;
		int i;
		
		for (i = 0; i < size; ++i){
			if ( isdigit(exp[i][0] ) 
			|| ( exp[i].length() > 1 && exp[i][0] == '-' && isdigit(exp[i][1] ) ) ){
				S.push(stod(exp[i] ) );
			}else{
				double b = S.top(); S.pop();
				double a = S.top(); S.pop();
				
				char ope = exp[i][0];

				switch (ope){
					case '+': res = a + b; break;
					case '-': res = a - b; break;
					case '*': res = a * b; break;
					case '/': res = a / b; break;
				} // end switch
				S.push (res);
			} // end if
		} // end for

		res = S.top();
		
		printf ("%.6f\n", res );
	} // end loop
		
	return 0;
}