#include <iostream>
#include <sstream>
#include <vector>
#include <string>
#include <stack>
#include <iomanip>

using namespace std;

#define MAX_DATA_NUM 10000000

int S[MAX_DATA_NUM];
int head;

void push(double num){
  S[head] = num;
  head++;
  if(head == MAX_DATA_NUM)head = 0;
}

double pop(){
  head--;
  double res = S[head];
  return res;
}

// ??\??????1???????????????, ??±??????????????¢??????????????????
// ??? : "10 2 12 - /" -> {"10", "2", "12", "-", "/"}
vector<string> read_input()
{
  string line;
  getline(cin, line);
  istringstream ss(line);

  vector<string> parsed_str;
  while (!ss.eof()) {
    string tmp; ss >> tmp;
    parsed_str.push_back(tmp);
  }

  return parsed_str;
}


double solve(vector<string> input_strs)
{
  for(int i = 0; i < input_strs.size(); i++){
    if(input_strs[i] == "+"){
      double a = pop(), b = pop();
      push(a + b);
    }else if(input_strs[i] == "-"){
      double a = pop(), b = pop();
      push(b - a);
    }else if(input_strs[i] == "*"){
      double a = pop(), b = pop();
      push(a * b);
    }else if(input_strs[i] == "/"){
      double a = pop(), b = pop();
      push(b / a);
    }else {
      push(stod(input_strs[i]));
    }
  }
  double res = pop();
  return res;
}


int main()
{
  while (true) {
    vector<string> input_strs = read_input();

    // ??¨?????????????????±??????????????????????????£???????????????????????????
    if (cin.eof()) break;

    double ans = solve(input_strs);
    cout << fixed << setprecision(10) << ans << endl;
  }
}