if __name__ == "__main__":
    stack =[]
    ope = {"+": lambda a, b: b + a, "-": lambda a, b: b - a, "*": lambda a, b: b * a}
    for x in input().split():
        if x in ope:
            stack.append(ope[x](stack.pop(),stack.pop()))
        else:
            stack.append(int(x))
    print(stack[-1]) if __name__ == "__main__":
    stack =[]
    ope = {"+": lambda a, b: b + a, "-": lambda a, b: b - a, "*": lambda a, b: b * a}
    for x in input().split():
        if x in ope:
            stack.append(ope[x](stack.pop(),stack.pop()))
        else:
            stack.append(int(x))
    print(stack[-1]) __name__ == "__main__" __name__ "__main__" stack =[] stack [] ope = {"+": lambda a, b: b + a, "-": lambda a, b: b - a, "*": lambda a, b: b * a} ope {"+": lambda a, b: b + a, "-": lambda a, b: b - a, "*": lambda a, b: b * a} "+" "+" lambda a, b: b + a b + a b a a b "-" "-" lambda a, b: b - a b - a b a a b "*" "*" lambda a, b: b * a b * a b a a b for x in input().split():
        if x in ope:
            stack.append(ope[x](stack.pop(),stack.pop()))
        else:
            stack.append(int(x))
     x input().split() ().split () input split if x in ope:
            stack.append(ope[x](stack.pop(),stack.pop()))
        else:
            stack.append(int(x))
     x in ope x ope stack.append(ope[x](stack.pop(),stack.pop())) stack.append stack append ope[x](stack.pop(),stack.pop()) [x] ope x stack.pop() stack.pop stack pop stack.pop() stack.pop stack pop stack.append(int(x)) stack.append stack append int(x) int x print(stack[-1]) print stack[-1] stack -1 ope = {"+": lambda a, b: b + a, "-": lambda a, b: b - a, "*": lambda a, b: b * a} {"+": lambda a, b: b + a, "-": lambda a, b: b - a, "*": lambda a, b: b * a} ope stack =[] [] stack
if __name__ == "__main__":
    stack =[]
    ope = {"+": lambda a, b: b + a, "-": lambda a, b: b - a, "*": lambda a, b: b * a}
    for x in input().split():
        if x in ope:
            stack.append(ope[x](stack.pop(),stack.pop()))
        else:
            stack.append(int(x))
    print(stack[-1])