#include<stdio.h>
#define N 100
#define M 99


int main(int argc,char *argv[]){

  int i,j,sum=0,k=0;
  int S[N];
  char t[M];
  for(i=0;i<argc;i++){
    scanf("%d",&S[i]);
    push(S[i]);
    if(S[i]== + || S[i]== - || S[i] == *){
      sum = S[i-1]+S[i-2];
      pop();
      pop();
      push(sum);
      }
    sum=0;
  }

  printf("%d",sum);
}