Add subtract and multiply
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
Let be a variable initially equals to . Simulate the next operations with this variable:
add : add value to ;
subtract : subtract value from ;
multiply : multiply by ;
Input
Each line contains operation and value. Process all given operations. The value of the variable after each operation doen not exceed by absolute value.
Output
Print the resulting value of .
Examples
Input #1
Answer #1
Input #2
Answer #2
Submissions 3K
Acceptance rate 55%