input_line = [str(s) for s in input().split()]
input_line = input_line[::-1]
tmp_number = []
while(len(input_line) != 0):
    tmp = input_line[-1]
    if tmp == "+":
        tmp_number[-2] = tmp_number[-2] + tmp_number[-1]
        tmp_number.pop()
    elif tmp == "-":
        tmp_number[-2] = tmp_number[-2] - tmp_number[-1]
        tmp_number.pop()
    elif tmp == "*":
        tmp_number[-2] = tmp_number[-2] * tmp_number[-1]
        tmp_number.pop()
    else:
        tmp_number.append(int(tmp))
    input_line.pop()
print(tmp_number[0]) str(s) for s in input().split() for s in input().split() s input().split() ().split () input split for s in input().split() str(s) str s input_line = [str(s) for s in input().split()] input_line [str(s) for s in input().split()] input_line = input_line[::-1] input_line input_line[::-1] input_line ::-1 -1 tmp_number = [] tmp_number [] while(len(input_line) != 0):
    tmp = input_line[-1]
    if tmp == "+":
        tmp_number[-2] = tmp_number[-2] + tmp_number[-1]
        tmp_number.pop()
    elif tmp == "-":
        tmp_number[-2] = tmp_number[-2] - tmp_number[-1]
        tmp_number.pop()
    elif tmp == "*":
        tmp_number[-2] = tmp_number[-2] * tmp_number[-1]
        tmp_number.pop()
    else:
        tmp_number.append(int(tmp))
    input_line.pop() len(input_line) != 0 len(input_line) len input_line 0 tmp = input_line[-1] tmp input_line[-1] input_line -1 if tmp == "+":
        tmp_number[-2] = tmp_number[-2] + tmp_number[-1]
        tmp_number.pop()
    elif tmp == "-":
        tmp_number[-2] = tmp_number[-2] - tmp_number[-1]
        tmp_number.pop()
    elif tmp == "*":
        tmp_number[-2] = tmp_number[-2] * tmp_number[-1]
        tmp_number.pop()
    else:
        tmp_number.append(int(tmp))
     tmp == "+" tmp "+" tmp_number[-2] = tmp_number[-2] + tmp_number[-1] tmp_number[-2] tmp_number -2 tmp_number[-2] + tmp_number[-1] tmp_number[-2] tmp_number -2 tmp_number[-1] tmp_number -1 tmp_number.pop() tmp_number.pop tmp_number pop elif tmp == "-":
        tmp_number[-2] = tmp_number[-2] - tmp_number[-1]
        tmp_number.pop()
     tmp == "-" tmp "-" tmp_number[-2] = tmp_number[-2] - tmp_number[-1] tmp_number[-2] tmp_number -2 tmp_number[-2] - tmp_number[-1] tmp_number[-2] tmp_number -2 tmp_number[-1] tmp_number -1 tmp_number.pop() tmp_number.pop tmp_number pop elif tmp == "*":
        tmp_number[-2] = tmp_number[-2] * tmp_number[-1]
        tmp_number.pop()
     tmp == "*" tmp "*" tmp_number[-2] = tmp_number[-2] * tmp_number[-1] tmp_number[-2] tmp_number -2 tmp_number[-2] * tmp_number[-1] tmp_number[-2] tmp_number -2 tmp_number[-1] tmp_number -1 tmp_number.pop() tmp_number.pop tmp_number pop tmp_number.append(int(tmp)) tmp_number.append tmp_number append int(tmp) int tmp input_line.pop() input_line.pop input_line pop print(tmp_number[0]) print tmp_number[0] tmp_number 0 input_line = [str(s) for s in input().split()] [str(s) for s in input().split()] input_line tmp_number = [] [] tmp_number tmp = input_line[-1] input_line[-1] tmp input_line = input_line[::-1] input_line[::-1] input_line
input_line = [str(s) for s in input().split()]
input_line = input_line[::-1]
tmp_number = []
while(len(input_line) != 0):
    tmp = input_line[-1]
    if tmp == "+":
        tmp_number[-2] = tmp_number[-2] + tmp_number[-1]
        tmp_number.pop()
    elif tmp == "-":
        tmp_number[-2] = tmp_number[-2] - tmp_number[-1]
        tmp_number.pop()
    elif tmp == "*":
        tmp_number[-2] = tmp_number[-2] * tmp_number[-1]
        tmp_number.pop()
    else:
        tmp_number.append(int(tmp))
    input_line.pop()
print(tmp_number[0])