#C6478. Calculate Final Score
Calculate Final Score
Calculate Final Score
You are given a series of operations that affect a player's score. Initially, the score is 0. Each operation is represented by a string starting with an operator (+, -, *, or /) followed by an integer.
The operations are applied sequentially in the order given. For multiplication and division, the usual arithmetic rules apply, with division being integer division. Formally, if the initial score is \(S_0 = 0\) and for each operation \(op_i\) with operator \(\otimes\) and operand \(v_i\) the updated score is computed as:
\[ S_i = S_{i-1} \otimes v_i \]
Your task is to compute the final score \(S_n\) after all operations are processed.
inputFormat
The first line contains an integer \(n\), representing the number of operations.
The following \(n\) lines each contain a string representing an operation. The string always starts with one of the characters '+', '-', '*', or '/' followed by a non-negative integer.
outputFormat
Output a single integer representing the final score after applying all the operations.
## sample1
+5
5