14858 - Expression calculator   

Description

HARD DO OTHER PROBLEM FIRST

This program implements a simple integer calculator.

The input is a valid arithmetic expression on a single line.

The expression contains integers (possibly negative), operators + - * /.

All tokens are separated by spaces. Example:

2 + 3 * 4 * -9

You must evaluate the expression while respecting ordinary arithmetic precedence:

* and / have higher precedence than + and -.

Only one number should be printed: the final result of the expression.

 

Here is a step-by-step evaluation for Sample Input 1.

 

Input

A single line consisting of integers and operators + - * /, separated by spaces.

The expression is always guaranteed to be valid.

Output

Output exactly one integer: the result of the expression.

The final computed answer is guaranteed to be an integer value.

Ensure that the output formatting matches exactly.

Sample Input  Download

Sample Output  Download

Tags

11410EE 231002



Discuss