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

using namespace std;

int main() {
  string str;
  while(getline(cin, str)) {
    stack<double> S;
    stringstream sin(str);
    string temp;
    while(sin >> temp) {
      bool flag = false;
      if(temp.length() == 1) {
	flag = true;
	switch(temp[0]) {
	  double a, b;
	case '+':
	  a = S.top();S.pop();
	  b = S.top();S.pop();
	  S.push(b+a);
	  break;
	case '-':
	  a = S.top();S.pop();
	  b = S.top();S.pop();
	  S.push(b-a);
	  break;
	case '*':
	  a = S.top();S.pop();
	  b = S.top();S.pop();
	  S.push(b*a);
	  break;
	case '/':
	  a = S.top();S.pop();
	  b = S.top();S.pop();
	  S.push(b/a);
	  break;
	default:
	  flag = false;
	}
      }
      if(!flag) {
	stringstream s1(temp);
	double d;
	s1 >> d;
	S.push(d);
      }
    }
    printf("%.6f\n", S.top());
  }
  return 0;
}