#K59467. Arithmetic Expression Evaluation

    ID: 30871 Type: Default 1000ms 256MiB

Arithmetic Expression Evaluation

Arithmetic Expression Evaluation

You are given a valid arithmetic expression S consisting of non-negative integers and the operators +, -, *, and /. The expression does not include any parentheses.

Your task is to evaluate the expression following the standard operator precedence: multiplication and division are evaluated before addition and subtraction. Note that division should be treated as integer division, meaning the result is truncated towards zero.

Examples:

  • 3+2*2 evaluates to 7
  • 3/2 evaluates to 1
  • 3+5 / 2 evaluates to 5

inputFormat

The input consists of a single line containing the arithmetic expression S. The expression may include spaces.

outputFormat

Output a single integer which is the result of evaluating the expression.

## sample
3+2
5