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

using namespace std;

void solve()
{
	string str;
	while(getline(cin, str))
	{
		stack<double> Stack;
		char a[100];
		int size = str.size();
		int pos = 0;
		for(int i = 0; i < size; ++i)
		{
			if(str[i] == ' ')
			{
				if(a[0] == NULL)
				{
					continue;
				}
				int n = atoi(a);
				for(int i = pos; i >= 0; --i)
				{
					a[i] = NULL;
				}
				Stack.push(n);
				pos = 0;
			}
			else if(str[i] == '+' || str[i] == '-' || str[i] == '*' || str[i] == '/')
			{
				double num[2];
				num[0] = Stack.top();
				Stack.pop();
				num[1] = Stack.top();
				Stack.pop();
				if(str[i] == '+')
				{
					Stack.push(num[1] + num[0]);
				}
				else if(str[i] == '-')
				{
					Stack.push(num[1] - num[0]);
				}
				else if(str[i] == '*')
				{
					Stack.push(num[1] * num[0]);
				}
				else if(str[i] == '/')
				{
					Stack.push(num[1] / num[0]);
				}
			}
			else
			{
				a[pos] = str[i];
				pos++;
			}
		}
		printf("%.6f\n", Stack.top());
	}
}

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