#include <iostream>
#include <sstream>
#include <stack>
#include <cstdlib>
#include <string>

using namespace std;

void solve()
{
	string str;
	string a;
	while(getline(cin, str))
	{
		stack<double> Stack;
		stringstream ss;
		ss << str;
		while(ss >> a)
		{
			if(a == "+" || a == "-" || a == "*" || a == "/")
			{
				double num[2];
				num[0] = Stack.top();
				Stack.pop();
				num[1] = Stack.top();
				Stack.pop();
				if(a == "+")
				{
					Stack.push(num[1] + num[0]);
				}
				else if(a == "-")
				{
					Stack.push(num[1] - num[0]);
				}
				else if(a == "*")
				{
					Stack.push(num[1] * num[0]);
				}
				else if(a == "/")
				{
					Stack.push(num[1] / num[0]);
				}
			}
			else
			{
				Stack.push(atof(a.c_str()));
			}
		}
		printf("%.6f\n", Stack.top());
	}
}

int main()
{
	solve();
	return(0);
}