#include<stdio.h>
#include<stdlib.h>
#define MAX 100

void calc_a();
void calc_b();
void calc_c();
void push(int);
int pop();
int isEmpty();
int isFull();

int top = 0,stack[MAX];

int main(){
  int x,rlt;
  char s[MAX];

  while( scanf("%s",s) != EOF ){
    if ( s[0] == '+' ){
      calc_a();
    } else if ( s[0] == '-' ){
      calc_b();
    } else if ( s[0] == '*' ){
      calc_c();
    } else {
      x = atoi(s);
      push(x);
    }
  }
  rlt=pop();
  printf("%d\n",rlt);
  return 0;
}

void calc_a(){
  int x,y,z;
  y = pop();
  x = pop();
  z = x + y;
  push(z);
}

void calc_b(){
  int x,y,z;
  y = pop();
  x = pop();
  z = x - y;
  push(z);
}

void calc_c(){
  int x,y,z;
  y = pop();
  x = pop();
  z = x*y;
  push(z);
}

void push(int x){
  int full;
  full = isFull();
  if(full == 1){
    printf("error_Full\n");
    exit(0);
  }
  top++;
  stack[top] = x;
}

int pop(){
  int empty;
  empty = isEmpty();
  if(empty == 1){
    printf("error_Empty\n");
    exit(0);
  }
  top--;
  return stack[top + 1];
}

int isEmpty(){
  if(top == 0) return 1;
  else return 0;
}

int isFull(){
  if(top >= MAX - 1) return 1;
  else return 0;
}

