#include <stdio.h>
int push(int);
int pop(void);
void isEmpty();
void isFull();
int hantei(char *);
int mozi(char *);
int toridashi(char *);

int S[100];
int size=0;

int main(){

  char stack[100];
  int i,j,top;

  scanf("%s",stack);
  printf("%s = %d\n", stack, mozi(stack));

  return 0;
}

int mozi(char *stack)
{
  int a,b,c;
  while(*stack){
    if(hantei(stack)){
      c=toridashi(stack);
      push(c);
      while(*stack=='-' || *stack =='+'){
	stack++;
      }
      while(c){
	c/=10;
	stack++;
      }
    }
    else{
      if(*stack=='+'){
	a=pop();
	b=pop();
	push(a+b);
	break;
      }
      else if(*stack=='-'){
	a=pop();
	b=pop();
	push(a-b);
	break;
      }
      else if(*stack=='*'){
	a=pop();
	b=pop();
	push(a*b);
	break;
      }
      stack++;
    }
  }
  return pop();
}


int hantei(char *stack){

  if(*stack=='+' || *stack=='-'){
    stack++;
    if(*stack>='0' && *stack<='9')return 1;
    return 0;
  }
  if(*stack>='0' && *stack<= '9')return 1;
  return 0;
}

  
int toridashi(char *stack){
   int x=0,y=0;

   if(*stack=='+'){
     stack++;
   }
   else if(*stack=='-'){
     x=1;
     stack++;
   }
   while(*stack>='0' && *stack<='9'){
     y=y*10+(*stack-'0');
     stack++;
   }
   if(x) return -y;
   return y;
}

int push(int c){

  S[size++]=c;
}

int pop(){
  if(size<=0)return 0;
  return S[--size];
}
  