#P1981. Arithmetic Expression Evaluation

    ID: 15263 Type: Default 1000ms 256MiB

Arithmetic Expression Evaluation

Arithmetic Expression Evaluation

Given an arithmetic expression that contains only addition ('+') and multiplication ('*') operations, compute the value of the expression.

The expression is a string and follows the standard operator precedence:

\(a + b * c = a + (b \times c)\)

All numbers in the expression are non-negative integers and may consist of multiple digits.

inputFormat

The input consists of a single line containing the expression.

For example: 1+2*3

outputFormat

Output the computed integer result of the expression.

For example, the output for the expression above is 7.

sample

1+2*3
7