#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <sstream>
#include <functional>
#include <numeric>
#include <cmath>
#include <cstring>
#include <queue>
#include <stack>
#include <set>

using namespace std;

const int INF = 1 << 29;
typedef pair<int, int> P;

int n;

int main(void)
{
	string str;
	int count = 0;
	while(getline(cin, str), str != "")
	{
		count++;
		stack<double> stack;
		stringstream ss(str);
		while (!ss.eof())
		{
			string tmp;
			ss >> tmp;
			if(tmp[0] == '+')
			{
				double num1 = stack.top(); stack.pop();
				double num2 = stack.top(); stack.pop();
				stack.push(num1 + num2);
			}
			else if(tmp[0] == '-')
			{
				double num1 = stack.top(); stack.pop();
				double num2 = stack.top(); stack.pop();
				stack.push(num2 - num1);
			}
			else if(tmp[0] == '*')
			{
				double num1 = stack.top(); stack.pop();
				double num2 = stack.top(); stack.pop();
				stack.push(num1 * num2);
			}
			else if(tmp[0] == '/')
			{
				double num1 = stack.top(); stack.pop();
				double num2 = stack.top(); stack.pop();
				stack.push(num2 / num1);
			}
			else
			{
				stack.push(atoi(tmp.c_str()));
			}
		}
		cout << stack.top() << endl;
		stack.pop();
		if(count > 2) return 0;
	}
	return 0;
}