#include<stack>
#include<string>
#include<vector>
#include<iostream>
#include<stdio.h>
#include<stdlib.h>
using namespace std;

int main(){
  string line,tmp="";
  char *e;
  double s,lop,rop;
  vector<string> splited;
  int pos;

  while(getline(cin,line)){
    tmp="";

    for(int i=0; i<line.size() ; ++i){
      if ( line.at(i) != 32) tmp+=line.at(i);
      else splited.push_back(tmp),tmp="";
    }

    splited.push_back(tmp);

    stack<double> st;

    for(vector<string>::iterator it=splited.begin(); it != splited.end(); ++it){
      //cout<<(*it)<<endl;
      if((*it)=="+"||(*it)=="-"||(*it)=="*"||(*it)=="/") {
	lop=st.top();
	st.pop();
	rop=st.top();
	st.pop();
	//cout<<lop<<" "<<rop<<endl;
	if(*it == "+") st.push(rop+lop);
	if(*it == "-") st.push(rop-lop);
	if(*it == "*") st.push(rop*lop);
	if(*it == "/") st.push(rop/lop);
	//cout<<st.top()<<endl;
	continue;
      }else{
	s = strtod((*it).c_str(),&e);
	st.push(s);
      }
    }

    printf("%.6f\n",st.top());
    splited.clear();

  }
}