answer = op = 0
while true
	x = gets.chomp
	break if x == "="

	if index = "+-*/".index(x)
	    op = index
	else
		x = x.to_i
		case op
		when 0 then answer += x
		when 1 then answer -= x
		when 2 then answer *= x
		when 3 then answer /= x
		end
	end
end
puts answer
