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

double a,b,n,z;
string s;
stack < double > stk;

void solve(char c){
  b = stk.top();
  stk.pop();
  a = stk.top();
  stk.pop();

  if(c == '+'){
    n = a + b;
    stk.push(n);
  }
  else if(c == '-'){
    n = a - b;
    stk.push(n);
  }
  else if(c == '*'){
    n = a * b;
    stk.push(n);
  }
  else if(c == '/'){
    n = a / b;
    stk.push(n);
  }

}

int main(){

  while(getline(cin,s)){
    z = 0;

    for(int i=0;i<s.size();i++){
      if(s[i] >= '0' && s[i] <= '9'){
	if(z < 0){
	  z *= 10;
	  z -= s[i]-'0';
	}
	else {
	  z *= 10;
	  z += s[i]-'0';
	}
	if(s[i-1] == '-') z *= -1;
      }

      else if(s[i] == '-' && s[i+1] >= '0' && s[i+1] <= '9');

      else if(s[i] == '+' || s[i] == '-' || s[i] == '*' || s[i] == '/') solve(s[i]);
      
      else if(s[i] == ' ' && (s[i-1] >= '0' && s[i-1] <= '9')){
	stk.push(z);
	z = 0;
      }
      
    }

    if(s.size() == 1){
      z = s[0]-'0';
      printf("%.6f\n",z);
    }

    else printf("%.6f\n",stk.top());

    while(!stk.empty()) stk.pop();

  }
}