args = input().split()
stack = []

def cal_with_operator(b, a, operator):
    return eval('{} {} {}'.format(a, operator, b))

for s in args:
    if s == '+': stack.append(cal_with_operator(stack.pop(), stack.pop(), '+'))
    elif s == '-': stack.append(cal_with_operator(stack.pop(), stack.pop(), '-'))
    elif s == '*': stack.append(cal_with_operator(stack.pop(), stack.pop(), '*'))
    elif s == '/': stack.append(cal_with_operator(stack.pop(), stack.pop(), '/'))
    else : stack.append(s)

print(stack[0]) args = input().split() args input().split() ().split () input split stack = [] stack [] def cal_with_operator(b, a, operator):
    return eval('{} {} {}'.format(a, operator, b)) cal_with_operator return eval('{} {} {}'.format(a, operator, b)) eval('{} {} {}'.format(a, operator, b)) eval '{} {} {}'.format(a, operator, b) '{} {} {}'.format '{} {} {}' format a operator b b b a a operator operator for s in args:
    if s == '+': stack.append(cal_with_operator(stack.pop(), stack.pop(), '+'))
    elif s == '-': stack.append(cal_with_operator(stack.pop(), stack.pop(), '-'))
    elif s == '*': stack.append(cal_with_operator(stack.pop(), stack.pop(), '*'))
    elif s == '/': stack.append(cal_with_operator(stack.pop(), stack.pop(), '/'))
    else : stack.append(s) s args if s == '+': stack.append(cal_with_operator(stack.pop(), stack.pop(), '+'))
    elif s == '-': stack.append(cal_with_operator(stack.pop(), stack.pop(), '-'))
    elif s == '*': stack.append(cal_with_operator(stack.pop(), stack.pop(), '*'))
    elif s == '/': stack.append(cal_with_operator(stack.pop(), stack.pop(), '/'))
    else : stack.append(s) s == '+' s '+' elif s == '-': stack.append(cal_with_operator(stack.pop(), stack.pop(), '-'))
     s == '-' s '-' elif s == '*': stack.append(cal_with_operator(stack.pop(), stack.pop(), '*'))
     s == '*' s '*' elif s == '/': stack.append(cal_with_operator(stack.pop(), stack.pop(), '/'))
     s == '/' s '/' print(stack[0]) print stack[0] stack 0 stack = [] [] stack args = input().split() input().split() args def cal_with_operator(b, a, operator):
    return eval('{} {} {}'.format(a, operator, b)) def cal_with_operator(b, a, operator):
    return eval('{} {} {}'.format(a, operator, b)) cal_with_operator
args = input().split()
stack = []

def cal_with_operator(b, a, operator):
    return eval('{} {} {}'.format(a, operator, b))

for s in args:
    if s == '+': stack.append(cal_with_operator(stack.pop(), stack.pop(), '+'))
    elif s == '-': stack.append(cal_with_operator(stack.pop(), stack.pop(), '-'))
    elif s == '*': stack.append(cal_with_operator(stack.pop(), stack.pop(), '*'))
    elif s == '/': stack.append(cal_with_operator(stack.pop(), stack.pop(), '/'))
    else : stack.append(s)

print(stack[0])
