#include<stack>
#include<cstdio>
#include<cstdlib>
using namespace std;

int main()
{
	char RPN[100];
	stack<double> stk;

	while(fgets(RPN,100,stdin)!=NULL)
	{
		bool innum=false;
		int temp;
		
		for(int i=0;RPN[i]!='\n';i++)
		{
			if(RPN[i]>='0'&&RPN[i]<='9')
			{
				if(!innum)
				{
					innum=true;
					temp=RPN[i]-'0';
				}
				else
				{
					temp*=10;
					temp+=RPN[i]-'0';
				}
			}
			
			else if(RPN[i]==' ')
			{
				if(innum)
				{
					stk.push((double)temp);
					innum=false;
				}
			}
			
			else
			{
				double a,b;
				b=stk.top();
				stk.pop();
				a=stk.top();
				stk.pop();
				switch(RPN[i])
				{
				case '+':
					stk.push(a+b);
					break;
				case '-':
					stk.push(a-b);
					break;
				case '*':
					stk.push(a*b);
					break;
				case '/':
					stk.push(a/b);
					break;
				}
			}
		}
		printf("%lf\n",stk.top());
	}
	return 0;
}