#include <iostream>
#include <cstdio>
#include <stack>
using namespace std;

typedef string::const_iterator State;
stack<double> num;

double number(State &begin){
  double ret = 0;
  while(isdigit(*begin)){
    ret *= 10;
    ret += *begin - '0';
    begin++;
  }
  return ret;
}

void solve(State &begin){
  double op1, op2;
  if(*begin == '+'){
    op2 = num.top(); num.pop();
    op1 = num.top(); num.pop();
    num.push(op1 + op2);
  }else if(*begin == '-'){
    op2 = num.top(); num.pop();
    op1 = num.top(); num.pop();
    num.push(op1 - op2);
  }else if(*begin == '*'){
    op2 = num.top(); num.pop();
    op1 = num.top(); num.pop();
    num.push(op1 * op2);
  }else if(*begin == '/'){
    op2 = num.top(); num.pop();
    op1 = num.top(); num.pop();
    num.push(op1 / op2);
  }else if(isdigit(*begin)){
    num.push(number(begin));
  }
}

int main(void){
  string str;
  getline(cin, str);
  State begin = str.begin();
  while(begin != str.end()){
    solve(begin);
    begin++;
  }
  printf("%.6lf\n", num.top());
  return 0;
}