#include<cstdio>
#include<cstring>
#include<string>
#include<stack>
#include<vector>
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
  char buf[256];
  while(cin.getline(buf,sizeof(buf))){
    vector<string> s;
    string S = buf;
    int sc = 0;
    S+=" ";

    for(int i=0;i<(int)S.size();i++){
      if(S[i]==' '){
	s.push_back(S.substr(sc,i-sc));
	sc = i+1;
      }
    }
    stack<double> st;
    for(int i=0;i<(int)s.size();i++){
      if('9'>=s[i][0] && s[i][0]>='0'){
	double c;
	sscanf(s[i].c_str(),"%lf",&c);
	st.push(c);
      } else{
	double k1 = st.top(); st.pop();
	double k2 = st.top(); st.pop();
	if(s[i][0]=='+')
	  st.push(k2+k1);
	else if(s[i][0]=='-')
	  st.push(k2-k1);
	else if(s[i][0]=='/')
	  st.push(k2/k1);
	else if(s[i][0]=='*')
	  st.push(k2*k1);
      }
    }
    printf("%lf\n",st.top());
      while(!st.empty()) st.pop();

  }
}