operands = ["+","-","*"]
symbols = raw_input().split()
ans = 0
i = 0
while True:
    if len(symbols) == 1:
        break
    if symbols[i] in operands:
        a = int(symbols.pop(i-2))
        b = int(symbols.pop(i-2))
        o = symbols.pop(i-2)
        if o == "*":
            symbols.insert(i-2,a*b)
        elif o == "+":
            symbols.insert(i-2,a+b)
        elif o == "-":
            symbols.insert(i-2,a-b)
        else:
            "This operand is invalid."
            break
        i-=1
    else:
        i+=1
print symbols[0] operands = ["+","-","*"] operands ["+","-","*"] "+" "-" "*" symbols = raw_input().split() symbols raw_input().split() ().split () raw_input split ans = 0 ans 0 i = 0 i 0 while True:
    if len(symbols) == 1:
        break
    if symbols[i] in operands:
        a = int(symbols.pop(i-2))
        b = int(symbols.pop(i-2))
        o = symbols.pop(i-2)
        if o == "*":
            symbols.insert(i-2,a*b)
        elif o == "+":
            symbols.insert(i-2,a+b)
        elif o == "-":
            symbols.insert(i-2,a-b)
        else:
            "This operand is invalid."
            break
        i-=1
    else:
        i+=1 True if len(symbols) == 1:
        break
     len(symbols) == 1 len(symbols) len symbols 1 break if symbols[i] in operands:
        a = int(symbols.pop(i-2))
        b = int(symbols.pop(i-2))
        o = symbols.pop(i-2)
        if o == "*":
            symbols.insert(i-2,a*b)
        elif o == "+":
            symbols.insert(i-2,a+b)
        elif o == "-":
            symbols.insert(i-2,a-b)
        else:
            "This operand is invalid."
            break
        i-=1
    else:
        i+=1 symbols[i] in operands symbols[i] symbols i operands a = int(symbols.pop(i-2)) a int(symbols.pop(i-2)) int symbols.pop(i-2) symbols.pop symbols pop i-2 i 2 b = int(symbols.pop(i-2)) b int(symbols.pop(i-2)) int symbols.pop(i-2) symbols.pop symbols pop i-2 i 2 o = symbols.pop(i-2) o symbols.pop(i-2) symbols.pop symbols pop i-2 i 2 if o == "*":
            symbols.insert(i-2,a*b)
        elif o == "+":
            symbols.insert(i-2,a+b)
        elif o == "-":
            symbols.insert(i-2,a-b)
        else:
            "This operand is invalid."
            break
         o == "*" o "*" symbols.insert(i-2,a*b) symbols.insert symbols insert i-2 i 2 a*b a b elif o == "+":
            symbols.insert(i-2,a+b)
         o == "+" o "+" symbols.insert(i-2,a+b) symbols.insert symbols insert i-2 i 2 a+b a b elif o == "-":
            symbols.insert(i-2,a-b)
         o == "-" o "-" symbols.insert(i-2,a-b) symbols.insert symbols insert i-2 i 2 a-b a b "This operand is invalid." break i-=1 i 1 i+=1 i 1 print symbols[0] symbols 0 operands = ["+","-","*"] ["+","-","*"] operands symbols = raw_input().split() raw_input().split() symbols b = int(symbols.pop(i-2)) int(symbols.pop(i-2)) b i+=1 1 i i = 0 0 i i-=1 1 i a = int(symbols.pop(i-2)) int(symbols.pop(i-2)) a o = symbols.pop(i-2) symbols.pop(i-2) o ans = 0 0 ans
operands = ["+","-","*"]
symbols = raw_input().split()
ans = 0
i = 0
while True:
    if len(symbols) == 1:
        break
    if symbols[i] in operands:
        a = int(symbols.pop(i-2))
        b = int(symbols.pop(i-2))
        o = symbols.pop(i-2)
        if o == "*":
            symbols.insert(i-2,a*b)
        elif o == "+":
            symbols.insert(i-2,a+b)
        elif o == "-":
            symbols.insert(i-2,a-b)
        else:
            "This operand is invalid."
            break
        i-=1
    else:
        i+=1
print symbols[0]