#C1536. Taco Score Calculation
Taco Score Calculation
Taco Score Calculation
You are given a sequence of game notes where each note is either a hit or a miss. The game rules are as follows:
- The player starts with a multiplier of 1.
- For each consecutive
hit
, the current multiplier is added to the score and then increased by 1, but it cannot exceed 4. - A
miss
resets the multiplier back to 1 without adding to the score.
The overall score is the sum of the multipliers for every note that is a hit.
Formally, if we denote the score contribution for the i-th note as \( s_i \), then the total score is \( Score = \sum_{i=1}^{M} s_i \), where the multiplier resets to 1 on a miss and increases by 1 (up to a maximum of 4) on a hit.
inputFormat
The input is read from stdin and has the following format:
- The first line contains an integer \( M \) representing the number of notes.
- The next \( M \) lines each contain a single string which is either
hit
ormiss
.
outputFormat
Output a single integer to stdout which is the total score computed based on the rules described above.
## sample0
0