#C1002. Evaluate Arithmetic Expression

    ID: 39179 Type: Default 1000ms 256MiB

Evaluate Arithmetic Expression

Evaluate Arithmetic Expression

You are given an arithmetic expression in the form of a string containing non-negative integers, the binary operators +, -, *, and /, as well as parentheses to denote precedence. The division operator performs integer division. Your task is to evaluate the expression correctly following the standard arithmetic order of operations.

For example, given the expression 100 * ( 2 + 12 ) / 14, you should compute:

100×(2+12)14=100100 \times \frac{(2+12)}{14} = 100

You need to parse the expression, handle the operator precedence, and compute the result.

inputFormat

The input consists of a single line containing a valid arithmetic expression. The tokens (numbers, operators, and parentheses) in the expression are separated by a single space.

For example: 3 + 5

outputFormat

Output a single integer, the result of evaluating the given arithmetic expression.

## sample
3 + 5
8