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

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

double stoi(string s){
  double k = 1.0,res = 0.0;
  for(int i = (int)s.size()-1;i>=0;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])){
	string tmp;
	tmp.push_back(str[pos]);
	while(1){
	  pos++;
	  if(str[pos] == ' ' || str[pos] == '\n')break;
	  tmp.push_back(str[pos]);
	}
	a.push(stoi(tmp));
      }else if(str[pos] == ' '){
	pos++;
      }else if(str[pos] == '-' && digit(str[pos+1])){
	string tmp;
	pos++;
	tmp.push_back(str[pos]);
	while(1){
	  pos++;
	  if(str[pos] == ' ' || str[pos] == '\n')break;
	  tmp.push_back(str[pos]);
	}
	a.push(-1*stoi(tmp));
      }else{
	double x,y;
	if(!a.empty()){
	  y = a.top();
	  a.pop();
	  if(!a.empty()){
	    x = a.top();
	    a.pop();
	    a.push(cal(x,y,str[pos]));
	  }else{
	    a.push(y);
	  }
	}
	pos++;
      }
    }
    
    if(a.empty())cout << 0 << endl;
    else cout << a.top() << endl;
    
  }
}