#include <iostream>
#include <vector>
#include <string>
#include <stack>
using namespace std;
#define rep(i,a) for(int i = 0 ; i < a ; i ++)


int main(void){
  string s;
  while(getline(cin,s)){
    vector<double> st;
    s += " ";
    rep(i,s.size()){
      if(s[i] == ' ')continue;
      if('0'<= s[i] && s[i] <='9'){
	int nex = 0;
	//cout<<"s"<<s[i]<<endl;
	while(s[i] != ' '){
	  nex = s[i] - '0' + nex * 10;
	  i ++;
	}
	st.push_back(nex);
	//rep(i,st.size())cout<<st[i]<<(i+1==st.size()?'\n':' ');
      }else{
	//rep(i,st.size())cout<<st[i]<<(i+1==st.size()?'\n':' ');
	double b = st.back();st.pop_back();
	//rep(i,st.size())cout<<st[i]<<(i+1==st.size()?'\n':' ');
	//cout<<b<<endl;
	double a = st.back();st.pop_back();
	//rep(i,st.size())cout<<st[i]<<(i+1==st.size()?'\n':' ');
	//cout<<a<<endl;
	//cout<<a<<" "<<s[i]<<" "<<b<<endl;
	switch(s[i]){
	case '-':
	  st.push_back(a-b);
	  break;
	case '+':
	  st.push_back(a+b);
	  break;
	case '*':
	  st.push_back(a*b);
	  break;
	case '/':
	  st.push_back(a/b);
	  break;
	}
      }
    }
    //cout<<st.front()<<endl;;
    printf("%.9f\n",st.front());
  }
}