#K6051. Evaluate Mathematical Expression
Evaluate Mathematical Expression
Evaluate Mathematical Expression
You are given a string representing a mathematical expression. The expression may contain non-negative integers, the operators \(+, -, \times, \div\) and parentheses \((\) and \()\). Your task is to evaluate the expression and output its integer result.
The evaluation should follow the usual operator precedence rules. Division is integer division (truncate toward zero).
Note: The input expression might contain spaces. You need to correctly handle nested parentheses as well.
inputFormat
The input consists of a single line containing a valid mathematical expression as a string.
outputFormat
Output a single integer which is the result of evaluating the expression.
## sample5
5