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

bool digit(char c){
  return (c>='0') && (c<='9');
}

double stoi(string s){
  int pos = -1;
  double k,res;
  for(int i=0;i<(int)s.size();i++){
    if(s[i] == '.')pos = i;
  }
  if(pos < 0){
    k = 1.0;
    res = 0.0;
    for(int i = (int)s.size()-1;i>=0;i--){
      res += (s[i]-'0') * k;
      k *= 10;
    }
  }else{
    k = 1.0;
    res = 0.0;
    for(int i = pos-1;i>=0;i--){
      res += (s[i]-'0') * k;
      k *= 10;
    }
    k = 1.0 / 10;
    for(int i=pos+1;i<(int)s.size();i++){
      res += (s[i]-'0') * k;
      k /= 10;
    }
  }
  return res;
}

double cal(double x, double y, char z){
  if(z == '-')return x-y;
  if(z == '*')return x*y;
  if(z == '/')return x/y;
  else return x+y;
}  

int main(){
  stack<double> a;
  char str[100];

  while(fgets(str,100,stdin)!=NULL){
    int pos = 0;
    while(1){
      if(str[pos] == '\n')break;
      if(digit(str[pos])){
	char tmp[100];
	int n = 0;
	tmp[n] = str[pos];
	while(1){
	  n++;
	  pos++;
	  if(str[pos] == ' ' || str[pos] == '\n')break;
	  tmp[n] = str[pos];
	}
	tmp[n] = '\0';
	a.push(atof(tmp));
      }else if(str[pos] == ' '){
	pos++;
      }else if(str[pos] == '-' && digit(str[pos+1])){
	char tmp[100];
	int n = 0;
	tmp[n] = str[pos];
	while(1){
	  n++;
	  pos++;
	  if(str[pos] == ' ' || str[pos] == '\n')break;
	  tmp[n] = str[pos];
	}
	tmp[n] = '\0';
	a.push(atof(tmp));
      }else{
	double x,y;
	y = a.top();
	a.pop();
	x = a.top();
	a.pop();
	a.push(cal(x,y,str[pos]));
	pos++;
      }
    }
    
    cout << a.top() << endl;
    
  }
}