#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cassert>
#include <vector>
#include <string>
#include <cmath>
#include <map> 
#include <sstream>
#include <cstdio>
#include <complex>
#include <cstring>
using namespace std;
 
const int MAX= 10000100;

#define loop(i,a,b) for(int i = a ; i < b ; i ++)
#define rep(i,a) loop(i,0,a)
#define all(a) (a).begin(),(a).end()
#define ll long long int
#define gcd(a,b) __gcd(a,b)
#define pb(a) push_back(a)
int GCD(int a, int b) {if(!b) return a; return gcd(b, a%b);}
int lcm(int a, int b) {return a*b / gcd(a, b);}

bool inNum(char num){
  return ('0' <= num && num <+ '9');
}
int main(void){
  string s;
  while(getline(cin,s)){
    vector<double> sta;
    double d = 0;
    rep(i,s.size()){
      if(s[i] == ' '){
	if(d != 0){
	  sta.pb(d);
	  d = 0;
	}
      }else if(inNum(s[i])){
	d = d * 10 + s[i] - '0';
      }else if(s[i] == '+'){
	int a = sta.back(); sta.pop_back();
	int b = sta.back(); sta.pop_back();
	//cout<<" +"<<a+b<<endl;
	sta.pb(a+b);
      }else if(s[i] == '-'){
	int a = sta.back(); sta.pop_back();
	int b = sta.back(); sta.pop_back();
	//cout<<" -"<<a-b<<endl;
	sta.pb(b-a);
      }else if(s[i] == '/'){
	int a = sta.back(); sta.pop_back();
	int b = sta.back(); sta.pop_back();
	//cout<<" /"<<a/b<<endl;
	sta.pb(b/a);
      }else if(s[i] == '*'){
	int a = sta.back(); sta.pop_back();
	int b = sta.back(); sta.pop_back();
	//cout<<" *"<<a*b<<endl;
	sta.pb(b*a);
      }
    }
    cout<<sta.back()<<endl;
  }
}