while True:
try:
string = list(input())
result,lastSign,temp = [],'+','' #保存上一个符号
while string:
if string[0].isdigit():
temp += string[0]
else:
if lastSign == '+':
result.append(float(temp))
elif lastSign == '-':
result.append(-float(temp))
elif lastSign == '*':
left = result.pop()
result.append(left*float(temp))
elif lastSign == '/':
left = result.pop()
result.append(left/float(temp))
lastSign = string[0]
temp = '' #如果当前为符号,那么计算后数字置空
string.pop(0)
if lastSign == '+':
result.append(float(temp))
elif lastSign == '-':
result.append(-float(temp))
elif lastSign == '*':
left = result.pop()
result.append(left * float(temp))
elif lastSign == '/':
left = result.pop()
result.append(left / float(temp))
print(int(sum(result)))
except Exception:
break