#include <bits/stdc++.h>
using namespace std;

int main() {
  string po;

  while (true) {
    getline(cin, po);
    if (po.size() == 0) break;

    stack<double> s;
    double x = 0, n = 1;
    bool f = false;
    for (int i = 0; i < po.size(); ++i) {
      if (po[i] == ' ') {
        if (f) s.push(x * n);
        x = 0; n = 1; f = false;
      } else if (po[i] == '-' && '0' <= po[i + 1] && po[i + 1] <= '9') {
        n = -1;
      } else if ('0' <= po[i] && po[i] <= '9') {
        x = 10 * x + (po[i] - '0');
        f = true;
      } else {
        double y = s.top();
        s.pop();
        double x = s.top();
        s.pop();

        if (po[i] == '+') s.push(x + y);
        if (po[i] == '-') s.push(x - y);
        if (po[i] == '*') s.push(x * y);
        if (po[i] == '/') s.push(x / y);
        // cout << x << " " << y << " " << s.top() << endl;
      }
    }

    printf("%.10f\n", s.top());
    // cout << po << endl;
  }
}