#include<stdio.h>
int main()
{
while (1)
{
int i,j,k,n,m,top = 0;
int stack[201]= {};
char str[201];
gets(str);
for (i=0; i<strlen(str); i++)
{
if ('0'<=str[i] && str[i]<='9')
{
stack[top] = str[i]-'0';
printf("%d",stack[i]);
}
else
{
if (str[i] = '*')
{
stack[top] = stack[top] * stack[top-1];
printf("%d",stack[top]);
}
}
}
}
}



