#C5695. Mathematical Expression Evaluator

    ID: 49372 Type: Default 1000ms 256MiB

Mathematical Expression Evaluator

Mathematical Expression Evaluator

You are given a string representing a mathematical expression that consists of non-negative integers and the operators +, -, *, and /. Your task is to evaluate the expression according to standard operator precedence rules. Specifically, multiplication and division are evaluated before addition and subtraction. For the division operator, use integer division, i.e. for any two integers \( a \) and \( b \) the result of \( a/b \) is defined as \( \lfloor \frac{a}{b} \rfloor \).

There will be no spaces in the expression, and the expression is guaranteed to be valid.

Example:

Input: 3+5*2
Output: 13

inputFormat

The input is provided via stdin as a single line containing the mathematical expression. For example:

3+5*2

outputFormat

Output the result of the evaluated expression as a single integer to stdout. For instance, for the above example the output is:

13

Note that division is performed as integer division, i.e. \( a/b = \lfloor \frac{a}{b} \rfloor \).

## sample
3+5
8

</p>