#include <iostream>
#include <stack>
#include <string>
#include <sstream>
#include <cstdio>

using namespace std;

bool debug = false;

double toint(string str){
  istringstream iss(str);
  double ret;

  iss >> ret;
  return ret;
}

int main(void){
  stack<double> st;
  string str;

  while(getline(cin, str)){
    string tmp = "";
    for(int i=0;i<str.size();i++){
      if(debug) cout << i << ":" << str[i] << endl;
      if(('0' <= str[i] && str[i] <= '9') || str[i] == '.'){
	tmp += str[i];
      }else if(str[i] == ' '){
	if(!tmp.empty()){
	  st.push(toint(tmp));
	  if(debug) cout << "pushed " << tmp << endl;
	  tmp.clear();
	}
      }else{
	double arg1, arg2;
	arg2 = st.top(); st.pop();
	arg1 = st.top(); st.pop();
	if(str[i] == '+'){
	  st.push(arg1+arg2);
	}else if(str[i] == '-'){
	  st.push(arg1 - arg2);
	}else if(str[i] == '*'){
	  st.push(arg1 * arg2);
	}else{
	  st.push(arg1 / arg2);
	}
      }
    }
    printf("%.6f\n", st.top());
    st.pop();
  }
  
}