#C4616. Counting Wins in a Chess Tournament
Counting Wins in a Chess Tournament
Counting Wins in a Chess Tournament
In this problem, you are given the performance data of a chess player in a tournament. For each dataset, the first line contains an integer n representing the number of rounds the player participated in. This is followed by n lines where each line is either "Win" or "Loss" indicating the result of that round.
The input consists of multiple datasets. A dataset with n = 0 indicates the end of input and should not be processed.
Your task is to compute the total number of wins for each dataset. Mathematically, if a dataset contains n rounds and I_i is an indicator function where I_i = 1 if the i-th round is a win and 0 otherwise, then the number of wins is given by:
\( wins = \sum_{i=1}^{n} I_i \)
Print the total number of wins for each dataset on a new line.
inputFormat
The input is read from standard input (stdin) and consists of multiple datasets. Each dataset is described as follows:
- The first line contains an integer n (n ≥ 0) indicating the number of rounds played.
- The next n lines each contain a string, either "Win" or "Loss", representing the outcome of each round.
The input terminates when a dataset with n = 0 is encountered. This terminating dataset should not be processed.
outputFormat
For each dataset (except the terminating one), output a single line containing the total number of wins. The output should be written to standard output (stdout).
## sample5
Win
Loss
Win
Win
Loss
0
3
</p>