LearnPy Hub
← Arena
EasyRating 1000

Score Keeper

Process operations: an integer records a score; + records the sum of the last two scores; D records double the last; C removes the last. Print the total.

Input

One line of operations.

Output

The total.

Sample 1

Input
5 2 C D +
Output
30

Sample 2

Input
5 -2 4 C D 9 + +
Output
27
solution.py
Output appears here
Score Keeper · Python Arena problem · LearnPy Hub