#--------------------A simple expression evaluator---------------#

import re, string
Inputbuf = []
	
# A token is either a number or an operator symbol. 
# The main program reads a line from the input and
# stores it in an array called Inputbuf. The function
# gettoken() returns individual tokens from this array.

def gettoken(): 
	global Inputbuf
	p = re.search('^\W*[\+\-\*/]|^\W*[0-9]+', Inputbuf)
	token = p.string[p.regs[0][0]:p.regs[0][1]]
	token = string.strip(token)
	if token not in ['+', '-', '*', '/']:
		token = int(token)
	Inputbuf = Inputbuf[p.regs[0][1]:]
	return token
	

# lookahead() peeks into the input stream and tells you what
# the next input token is
	
def lookahead():
	global Inputbuf
	try:
		p = re.search('^\W*[\+\-\*/]|^\W*[0-9]+', Inputbuf)
		token = p.string[p.regs[0][0]:p.regs[0][1]]
		token = string.strip(token)
		if token not in ['+', '-', '*', '/']:
			token = int(token)
		return token
	except:
		return None

	
def factor():
	return gettoken()


def term():
	e1 = factor()
	tmp = lookahead()
	while (tmp in ['*', '/']):
		gettoken()
		if (tmp == '*'):
			e1 = e1 * factor()
		else:
			e1 = e1 / factor()
		tmp = lookahead()

	return e1

	
def expression():
	e1 = term()
	tmp = lookahead()
	while (tmp in ['+', '-']):
		gettoken()
		if (tmp == '+'):
			e1 = e1 + term()
		else: 
			e1 = e1 - term()
		tmp = lookahead()
	
	return e1

	
def main():
	global Inputbuf
	Inputbuf = raw_input()
	print expression()

	
if __name__=='__main__':
	main()

