// editor4
#include<stdio.h>
#include<string.h>
#include<ctype.h>
# define max 20

char stack[max][max];
int top=0;
void push(char *c)
{
    strcpy(stack[top++],c);
}
char* pop()
{
    return stack[top--];
}

void inp(char *c)
{
    char *a;
    char *b;
    a[0]=pop();
    b[0]=pop();
    strcpy(a,b);
    strcat(a,c);
    push(a);
}
void print()
{
    for(int i=0;i<top;i++)
    {
        printf("%s",stack[top]);
    }
}


int main()
{
    char s[10];
    scanf("%s",s);
    for(int i=strlen(s)-1;i>=0;i--)
    {
        if(s[i]=='+'||s[i]=='-'||s[i]=='*'||s[i]=='/')
        {
            char *b;
            b[0]=s[i];
            inp(b);
        }
        else
        {
        char b[2];
        b[0]=s[i];
        push(b);
        }
    }
    print();
}