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

vector<string> parse(string s) {
  s += " ";
  vector<string> res;
  string str;
  for (int i = 0; i < s.size(); ++i) {
    if (s[i] == ' ') {
      res.push_back(str);
      str = "";
    } else str += s[i];
  }

  return res;
}

int main() {
  string s;
  while (getline(cin, s)) {
    vector<string> v = parse(s);

    // cout << s << endl;
    // for (string u : v) cout << u << endl;

    stack<double> st;
    for (string u : v) {
      if (u.size() == 1 && !('0' <= u[0] && u[0] <= '9')) {
        double b = st.top(); st.pop();
        double a = st.top(); st.pop();
        double x;
        if (u == "+") x = a + b;
        if (u == "-") x = a - b;
        if (u == "*") x = a * b;
        if (u == "/") x = a / b;
        st.push(x);
        // cout << a << " " << b << " " << x << endl;
      } else {
        double x = 0, num = 1;
        for (int i = 0; i < u.size(); ++i) {
          if ('0' <= u[i] && u[i] <= '9') {
            x = 10 * x + (u[i] - '0');
          } else num = -1;
        }

        st.push(x * num);
      }
    }

    printf("%.10f\n", st.top());
  }
}