#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) {
      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:
	stringstream s1(temp);
	double d;
	s1 >> d;
	S.push(d);
      }
    }
    printf("%.6f\n", S.top());
  }
  return 0;
}