#P9254. [PA 2022] Liczenie punktów

[PA 2022] Liczenie punktów

Problem Description

This problem is translated from PA 2022 Round 1 Liczenie punktów.

The judges of PA are tired of constantly calculating the scores for all submitted programs. Please help them automate this process.

For each problem, one submission can score from 00 to 1010 points. There are nn groups of testdata for a problem, and nn is divisible by 1010. If the program passes the first n10\frac{n}{10} groups, it gets 11 point. If it also passes the next n10\frac{n}{10} groups, it gets another 11 point, and so on. A submission earns 11 point independently for each block of n10\frac{n}{10} testdata groups that it passes completely. If there is an error in any group inside a block, then the submission gets 00 points for that block.

Notes:

  1. For simplicity, we assume that each block contains the same number of testdata groups, but in real programming contests this is not always the case.
  2. Any code you have written may be used to mess with you (the astronaut joke).

Input Format

The first line contains an integer nn, where nn is a multiple of 1010, representing the number of testdata groups.

The next line contains a string of length nn consisting only of T and N, describing the pass/fail result of each testdata group. T means the group is passed, and N means the group is not passed.

Output Format

Output one integer on a single line, representing the score of this submission.

20
TTNNTTNTNTNNNNNNNNTT

3

Hint

For 100%100\% of the data, it holds that:

10n10010\le n\le 100

Translated by ChatGPT 5