#include <iostream>
#include <iomanip>
#include <sstream>
#include <vector>
#include <string>
#include <map>
using namespace std;

vector<string> split(const string & str, char sep) {
  istringstream iss(str);
  string tmp;
  vector<string> ret;
  while (getline(iss, tmp, sep)) ret.push_back(tmp);
  return ret;
}

double stack[80];
int top;

void push(double e) {
  stack[top++] = e;
}

double pop(void) {
  return stack[--top];
}

int main(void) {
  string line;
  map<char, int> isop;
  isop['+'] = 1;
  isop['-'] = 1;
  isop['*'] = 1;
  isop['/'] = 1;
  while (getline(cin, line)) {
    vector<string> input = split(line, ' ');
    top = 0;
    for (auto e : input) {
      if (e.size() == 1 && isop[e[0]] == 1) {
        double rhs = pop();
        double lhs = pop();
        switch(e[0]){
          case '+':
            push(lhs + rhs);
            break;
          case '-':
            push(lhs - rhs);
            break;
          case '*':
            push(lhs * rhs);
            break;
          case '/':
            push(lhs / rhs);
            break;
        }
      } else {
        push(stod(e));
      }
    }
    cout << setprecision(6) << fixed << pop() << endl;
  }
  return 0;
}