A point-of-sale device records each receipt adjustment as a flat formula: a sequence of tokens alternating value, operator, value, operator, ... , value. Each value is an integer literal (it may be negative, e.g. -7; a negative literal always has more than one character, so it is never confused with the operator token -). Each operator is one of the single characters +, -, *, /.
Evaluate the formula strictly left to right with no operator precedence at all: apply each operator to the running result and the next value, in order. For example 2 + 3 * 4 is evaluated as (2 + 3) * 4 = 20, not 2 + 12. Division truncates toward zero (like integer division in C or Java), so -7 / 2 is -3.
It is guaranteed the token count is odd (values and operators alternate, starting and ending with a value) and that division by zero never occurs.
Input format
Line 1: an integer n, the number of tokens.
Line 2: n space-separated tokens.
Output format
A single integer: the value of the formula.
Constraints
- 1 <= n <= 99 (odd)
- Each integer literal has absolute value <= 1000000.
- Division by zero never occurs.
- Every intermediate result and the final value fit in a signed 64-bit integer.