#include <bits/stdc++.h>
using namespace std;
 
// #define int long long
 
/* short */
#define pb push_back
#define print(x) cout << x << '\n'
 
/* REPmacro */
#define REPS(i, a, n) for (int i = (a); i < (n); i++)
#define REP(i, n) for (int i = 0; i < (n); i++)
#define RREP(i, n) for (int i = 1; i <= (n); i++)
#define DEPS(i, a, n) for (int i = (a); i >= n; i--)
#define DEP(i, n) for (int i = (n); i >= 0; i--)

/* typedef */
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vector<int> > vii;
typedef pair<int, int> pii;

/* const */
const int INF = INT_MAX;
const int dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0};

/* func */
inline bool is_uruu(int y) {return (y % 4 == 0 && (y % 100 != 0 || y % 400 == 0));}

bool shinobu(string s)
{
  if (s == "/" || s == "*" || s == "+" || s == "-"){
    return (false);
  }

  return (true);
}

signed main()
{
  //ios::sync_with_stdio(false);
  string in;

  while (cin >> in){
    char c;
    stack<double> st;
    bool line = false;
    while (scanf("%c", &c), c == '\n' ? line = true : line = false, true){
      if (shinobu(in)){
        st.push(atof(in.c_str()));
        //cout << "tst: " << st.top() << endl;
      } else {
        double n1 = st.top(); st.pop();
        double n2 = st.top(); st.pop();
        if (in == "-"){
          st.push(n2 - n1);
        }
        if (in == "+"){
          st.push(n2 + n1);
        }
        if (in == "*"){
          st.push(n2 * n1);
        }
        if (in == "/"){
          st.push(n2 / n1);
        }
        //cout << "calc: " << n2 << in << n1 << "=" << st.top() << endl;
      }
      if (line) break;
      cin >> in;
    }
    printf("%f\n", st.top());
  }

  return (0);
}