Reverse Polish notation (RPN) is a mathematical notation in which every operator follows all of its operands. It is also known as postfix notation and does not need any parentheses as long as each operator has a fixed number of operands.
For example:
the expression 2+4 in RPN is represented like 2 4+
the expression 2∗4+8 in RPN is represented like 2 4∗8+
the expression 2∗(4+8) in RPN is represented like 2 4 8+∗
Evaluate the value of an arithmetic expression in Reverse Polish Notation. Valid operators are +, −, ∗, /. Operator / is an integer division (14 / 3=4). Each operand may be an integer or another expression.
One line contains expression written in Reverse Polish notation. The length of expression is no more than 100 symbols.
Print the value of expression given in Reverse Polish notation.