e-olymp
Competitions

Programming Principles 1. Week 6. October 7 - 13. PART 2

Arithmetic

Specifies the expression that contains only numbers and operations + and *. Calculate the value of the expression, assuming that the operations * and + have the same priority. In this case 2 + 2 * 2 equals 8.

Input

Given non-empty string S with no more than 9 characters. S line contains only numbers, and operators + and *. S always starts with a number and sets the correct recording of an arithmetic expression. Left and right of each operation is a figure to the left and to the right of each digit is placed or the beginning \ end of line, or a mathematical operation.

Output

Print the result of expression.

Time limit 1 second
Memory limit 128 MiB
Input example #1
1+1*2
Output example #1
4
Input example #2
2*9*4
Output example #2
72
Input example #3
5
Output example #3
5
Source The 2012 All-Ukrainian Collegiate Programming Contest Round I Training Contest 19 April 2012