#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using pii = pair<int, int>;

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  
  string s;
  while (getline(cin, s)) {
    stringstream ss(s);
    stack<double> st;
    string t, op = "+-*/";
    while (ss >> t) {
      if (op.find(t) == string::npos) {
        st.emplace(stoi(t));
      } else {
        double a, b;
        b = st.top(); st.pop();
        a = st.top(); st.pop();
        if (t == "+") st.emplace(a + b);
        else if (t == "-") st.emplace(a - b);
        else if (t == "*") st.emplace(a * b);
        else if (t == "/") st.emplace(a / b);
      }
    }
    cout << st.top() << endl;
  }

  return 0;
}
