~/algor $ cat problems/stack-qavsli-ifoda
Evaluating an expression with brackets
A correct arithmetic expression in ordinary notation is given. It contains integers from $0$ to $100$, the operations +, -, * and the brackets (, ), with no spaces. First what is inside brackets is done, then multiplication, then addition and subtraction; operations of the same priority are done from left to right (for example, the value of 8-3-2 is $3$). Find the value of the expression. Negative numbers (like -5) are not written in the expression.
Input
One line with the expression.
Output
One integer — the value of the expression.
Note
the length of the expression is from $1$ to $2 * 10^{5}$
each number is from $0$ to $100$, without unnecessary zeros
every intermediate value and the answer are from $-10^{18}$ to $10^{18}$
Examples
(3+4)*2-10
4
2*(5-8*(1+1))
-22