#C1536. Taco Score Calculation

    ID: 44752 Type: Default 1000ms 256MiB

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:

  1. The first line contains an integer \( M \) representing the number of notes.
  2. The next \( M \) lines each contain a single string which is either hit or miss.

outputFormat

Output a single integer to stdout which is the total score computed based on the rules described above.

## sample
0
0