#include<stack>
#include<cstdio>

using namespace std;

bool isope(char c){return c=='+'||c=='-'||c=='*'||c=='/';}

double calc(double a,char c,double b)
{
	switch(c){
		case '+':	return a+b;
		case '-':	return a-b;
		case '*':	return a*b;
		case '/':	return a/b;
	}
}

int main()
{
	while(1){
		stack<double> st;

		while(1){
			char s[16];
			int f=scanf("%s",s);
			if(!~f)	return 0;

			if(s[1]=='\0' && isope(s[0])){
				double b=st.top();	st.pop();
				double a=st.top();	st.pop();
				st.push(calc(a,s[0],b));
			}
			else{
				double a;
				sscanf(s,"%lf",&a);
				st.push(a);
			}

			if(getchar()=='\n')	break;
		}

		printf("%f\n",st.top());
	}
}