#include <iostream>
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
using namespace std;

double S[100000];
int f=0;

void push(double num){
  S[f]=num;
  f++;
}

double pop(){
  f--;
  double a=S[f];
  return a;
}

int main(){
  double num1,num2;
  char a[100000],str[100];
  gets(a);
  for(int i=0,j=0;a[i]!='\0';i++){
    //cout << j<<endl;
    if(a[i]=='+'||a[i]=='-'||a[i]=='*'||a[i]=='/'){
      num1=pop();
      num2=pop();
      switch(a[i]){
      case '+':
        push(num2+num1);
        break;
      case '-':
        push(num2-num1);
        break;
      case '*':
        push(num2*num1);
        break;
      case '/':
        push(num2/num1);
        break;
      }
      //num1=pop();
      //cout<<num1<<endl;
      //push(num1);
      i++;
      continue;
    }
    if(a[i]==' '||a[i]=='\0'){
      str[j]='\0';
      j=0;
      //printf("%s\n",str);
      push(atof(str));
      if(a[i]=='\0'){
        break;
      }
    }
    str[j]=a[i];j++;
  }
  cout<<pop()<<endl;
}