Skip to content
UPEEC

Evaluate Postfix Expression

Medium#stack· solved by 0 · time limit 2.0 s

Evaluate an expression in Reverse Polish (postfix) notation, e.g. 2 1 + 3 * = (2+1)×3=9(2+1) \times 3 = 9. Division truncates toward zero. All intermediate values fit in 32-bit integers.

Input

One line of tokens separated by spaces.

Output

The value.

Constraints

At most 10410^4 tokens.

Sample 1

Input

2 1 + 3 *

Output

9

Sample 2

Input

4 13 5 / +

Output

6

Sign in or join free to run and submit your solution.