Mirror Runs of the Season (easy version)
Every match a team plays in the league ends in one of three results: a win (W), a draw (D) or
a loss (L). Writing a team's results in the order the matches were played gives its season as a
string of n letters.
The league commentator hands out a mirror run award for every stretch of two or more
consecutive matches whose results read the same forwards and backwards. For example, in the
season WLLWD the stretches LL (matches 2–3) and WLLW (matches 1–4) are mirror runs, but LLW
and WD are not.
Every stretch counts on its own: two stretches are different if they start or end at a different match, even when their results are the same, and a stretch counts even if it overlaps or sits inside another mirror run. A single match is never a mirror run.
Given one team's season, count its mirror runs.
Input
The first line contains an integer n (1 ≤ n ≤ 100), the number of matches.
The second line contains a string s of exactly n characters, each W, D or L: the results
in the order the matches were played.
Output
Print one integer: the number of mirror runs in the season.
Notes
In the first example the season is WLLWDWD. Its mirror runs are LL (matches 2–3), WLLW
(matches 1–4), WDW (matches 4–6) and DWD (matches 5–7), so the answer is 4. The first two are
nested and the last two overlap; all of them count.
In the second example every stretch of two or more draws is a mirror run: three of length 2, two of length 3 and one of length 4, for 6 in total.
In the third example the season has a single match, so there are no mirror runs.