#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i=(b) - 1;i>=(a);i--)
#define REP(i,n) for(int i=0;i<(n);i++)
#define RREP(i,n) for(int i=n-1;i>=0;i--)

#define PB push_back
#define INF (1<<29)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define CLR(a) memset(a,0,sizeof(a))
#define fr first
#define sc second
const int dx[] = {-1,0,0,1},dy[] = {0,1,-1,0};

typedef long long int ll;

using namespace std;

int main(){
    while(true){
	string ss,s;
	stringstream str;
	getline(cin,ss);
	if(cin.eof())break;
	ss += " E";
	str.str(ss);
	double ans = 0.0;
	stack<double> st;
	int x = -1;

	while(true){
	str >> s;
	if(s == "E") break;
	if(s == "+"){
	    double a,b,c;
	    a = st.top();
	    st.pop();
	    b = st.top();
	    st.pop();
	    c = a + b;
	    st.push(c);
	}else if(s == "*"){
	    double a,b,c;
	    a = st.top();
	    st.pop();
	    b = st.top();
	    st.pop();
	    c = a * b;
	    st.push(c);
	}else if(s == "-"){
	    double a,b,c;
	    a = st.top();
	    st.pop();
	    b = st.top();
	    st.pop();
	    c = b - a;
	    st.push(c);
	}else if(s == "/"){
	    double a,b,c;
	    a = st.top();
	    st.pop();
	    b = st.top();
	    st.pop();
	    c = b / a;
	    st.push(c);
	}else{
	    st.push(stod(s));
	}
	}
	printf("%lf\n",st.top());
    }
    return 0;
}