/*
#include<stdio.h>
#include<stdlib.h>
#include<ctype.h>
#define N 100
double pop();
void push(double );
char s[N];
int i=0;

int main(){
  //int c;
  char x;
  double a,b,c;
  while(scanf("%c",&x) != EOF){
    if(isdigit(x)){
      //scanf("%d",&x);
      //c=atoi(x);
      push(x-'0');
    }else{
      switch(x){
        case '+':
          b=pop();a=pop();
          push(a+b);
          break;
        case '-':
          b=pop();a=pop();
          push(a-b);
          break;
        case '*':
          b=pop();a=pop();
          push(a-b);
          break;
        case '/':
          b=pop();a=pop();
          push(a/b);
          break;
        default:
          break;
      }
    }
  }
  printf("%f\n",pop());
  return 0;
}
double pop(){
  if(i<0) printf("error\n");
  else return s[--i];
}
void push(double a){
  if(i<100) s[i++] = a;
  else return;
}
*/
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<ctype.h>
typedef double ELEM;
#define STACK_SIZE 100
void error(char *);
void init();
void push(ELEM);
ELEM pop();
int empty();

ELEM stack[STACK_SIZE];
int n;

int main(){
	int c;
	double x,a,b;
	init();
	while((c=getchar()) != EOF){
		if(isdigit(c)){
			ungetc(c,stdin);
			scanf("%lf",&x);
			push(x);
		}else{
			switch(c){
				case '+':
					b=pop();a=pop();
					push(a+b);
					break;
				case '-':
					b=pop();a=pop();
					push(a-b);
					break;
				case '*':
					b=pop();a=pop();
					push(a*b);
					break;
				case '/':
					b=pop();a=pop();
					push(a/b);
					break;
				case '\n':
					if(!empty()) printf("%d\n",(int)pop());
					init();
					return 0;
					break;
				case ' ':
				case '\t':
					break;
				default:
					printf("error\n");
					printf("input again\n");
					while((c=getchar()) != EOF && c != '\n')
						;
					break;
			}
		}
	}
}
void error(char *s){
	fprintf(stderr,s);
	exit(1);
}
void init(){
	n=0;
}
void push(ELEM x){
	if(n>=STACK_SIZE) error("stack overflow!\n");
	stack[n++] = x;
}
ELEM pop(){
	if(n<=0) error("stack underflow!\n");
	return stack[--n];
}
int empty(){
	return n==0;
}
