def stack():
    A = list(input().split())
    lst = []
    
    def add(a, b):
        return b + a
    
    def sub(a, b):
        return b - a
        
    def mul(a, b):
        return b * a
    
    def div(a, b):
        return b / a
        
    def calc(lst, f):
        return lst.append(f(lst.pop(), lst.pop()))
    
    for i in A:
        if i == '+':
            calc(lst, add)
        elif i == '-':
            calc(lst, sub)
        elif i == '*':
            calc(lst, mul)
        elif i == '/':
            calc(lst, div)
        else: 
            lst.append(int(i))
    
    print(*lst)
    
stack() def stack():
    A = list(input().split())
    lst = []
    
    def add(a, b):
        return b + a
    
    def sub(a, b):
        return b - a
        
    def mul(a, b):
        return b * a
    
    def div(a, b):
        return b / a
        
    def calc(lst, f):
        return lst.append(f(lst.pop(), lst.pop()))
    
    for i in A:
        if i == '+':
            calc(lst, add)
        elif i == '-':
            calc(lst, sub)
        elif i == '*':
            calc(lst, mul)
        elif i == '/':
            calc(lst, div)
        else: 
            lst.append(int(i))
    
    print(*lst)
     stack A = list(input().split()) A list(input().split()) list input().split() ().split () input split lst = [] lst [] def add(a, b):
        return b + a
    
     add return b + a b + a b a a a b b def sub(a, b):
        return b - a
        
     sub return b - a b - a b a a a b b def mul(a, b):
        return b * a
    
     mul return b * a b * a b a a a b b def div(a, b):
        return b / a
        
     div return b / a b / a b a a a b b def calc(lst, f):
        return lst.append(f(lst.pop(), lst.pop()))
    
     calc return lst.append(f(lst.pop(), lst.pop())) lst.append(f(lst.pop(), lst.pop())) lst.append lst append f(lst.pop(), lst.pop()) f lst.pop() lst.pop lst pop lst.pop() lst.pop lst pop lst lst f f for i in A:
        if i == '+':
            calc(lst, add)
        elif i == '-':
            calc(lst, sub)
        elif i == '*':
            calc(lst, mul)
        elif i == '/':
            calc(lst, div)
        else: 
            lst.append(int(i))
    
     i A if i == '+':
            calc(lst, add)
        elif i == '-':
            calc(lst, sub)
        elif i == '*':
            calc(lst, mul)
        elif i == '/':
            calc(lst, div)
        else: 
            lst.append(int(i))
    
     i == '+' i '+' calc(lst, add) calc lst add elif i == '-':
            calc(lst, sub)
         i == '-' i '-' calc(lst, sub) calc lst sub elif i == '*':
            calc(lst, mul)
         i == '*' i '*' calc(lst, mul) calc lst mul elif i == '/':
            calc(lst, div)
         i == '/' i '/' calc(lst, div) calc lst div lst.append(int(i)) lst.append lst append int(i) int i print(*lst) print *lst lst stack() stack def stack():
    A = list(input().split())
    lst = []
    
    def add(a, b):
        return b + a
    
    def sub(a, b):
        return b - a
        
    def mul(a, b):
        return b * a
    
    def div(a, b):
        return b / a
        
    def calc(lst, f):
        return lst.append(f(lst.pop(), lst.pop()))
    
    for i in A:
        if i == '+':
            calc(lst, add)
        elif i == '-':
            calc(lst, sub)
        elif i == '*':
            calc(lst, mul)
        elif i == '/':
            calc(lst, div)
        else: 
            lst.append(int(i))
    
    print(*lst)
     def stack():
    A = list(input().split())
    lst = []
    
    def add(a, b):
        return b + a
    
    def sub(a, b):
        return b - a
        
    def mul(a, b):
        return b * a
    
    def div(a, b):
        return b / a
        
    def calc(lst, f):
        return lst.append(f(lst.pop(), lst.pop()))
    
    for i in A:
        if i == '+':
            calc(lst, add)
        elif i == '-':
            calc(lst, sub)
        elif i == '*':
            calc(lst, mul)
        elif i == '/':
            calc(lst, div)
        else: 
            lst.append(int(i))
    
    print(*lst)
     stack
def stack():
    A = list(input().split())
    lst = []
    
    def add(a, b):
        return b + a
    
    def sub(a, b):
        return b - a
        
    def mul(a, b):
        return b * a
    
    def div(a, b):
        return b / a
        
    def calc(lst, f):
        return lst.append(f(lst.pop(), lst.pop()))
    
    for i in A:
        if i == '+':
            calc(lst, add)
        elif i == '-':
            calc(lst, sub)
        elif i == '*':
            calc(lst, mul)
        elif i == '/':
            calc(lst, div)
        else: 
            lst.append(int(i))
    
    print(*lst)
    
stack()