eolymp
bolt
Try our new interface for solving problems
Problems

The postfix record

The postfix record

In postfix entry (or Reverse Polish Notation), the operation is recorded after the two operands. For example, the sum of two numbers \textbf{A} and \textbf{B} can be written as \textbf{A B +}. Record \textbf{B C + D *} denotes familiar to us \textbf{(B + C) * D}, and record \textbf{A B C + D * +} means \textbf{A + (B + C) * D}. The advantage of postfix entry in that it requires no brackets or additional agreements on the priority of the operators for their reading. \InputFile The single line contains an expression in postfix entries containing single digits and operations \textbf{+}, \textbf{-}, \textbf{*}. The string contains no more than \textbf{100} numbers and operations. \OutputFile Need to display the recorded value of expression. It is guaranteed that the result of expression as well as the results of all intermediate calculations of modulus less than \textbf{2^31}.
Time limit 1 second
Memory limit 64 MiB
Input example #1
8 9 + 1 7 - *
Output example #1
-102