﻿"""
Simple Calculator
"""

if __name__ == '__main__':
    number = []
    operator = []
    while True:
        x = raw_input()
        if x == "=":
            break
        elif x.isdigit():
            number.append(int(x))
        else:
            operator.append(x)
    number.reverse()
    while len(operator) > 0:
        a = number.pop()
        b = number.pop()
        o = operator.pop(0)
        if o == "+":
            number.append(a + b)
        elif o == "-":
            number.append(a - b)
        elif o == "*":
            number.append(a * b)
        elif o == "/":
            result = abs(a) / abs(b)
            if a < 0:result *= -1
            if b < 0:result *= -1
            number.append(result)
    print "{0}".format(number[0])
