#C7979. Game Outcome Summary

    ID: 51909 Type: Default 1000ms 256MiB

Game Outcome Summary

Game Outcome Summary

You are given a string that represents a series of game results. Each character in the string is one of W, L, or D, where:

  • W indicates a win for Alice.
  • L indicates a win for Bob.
  • D indicates a draw.

Your task is to count the number of wins for Alice, wins for Bob, and draws in the given string and output the three counts as space-separated integers.

Formally, if the input string is denoted by \(s\), you need to compute:

\[ \text{AliceWins} = \#\{ i : s_i = 'W' \}, \quad \text{BobWins} = \#\{ i : s_i = 'L' \}, \quad \text{Draws} = \#\{ i : s_i = 'D' \} \]

inputFormat

A single line of input containing a non-empty string consisting only of the characters 'W', 'L', and 'D'. The string may be empty.

outputFormat

Print three space-separated integers representing the number of wins for Alice, the number of wins for Bob, and the number of draws, respectively.## sample

WWLDLW
3 2 1