409350: GYM103488 D Diseased String
Description
You are given a string $$$s$$$ of length $$$n$$$ consisting of lowercase English letters. A $$$ybb$$$ substring $$$t$$$ is defined as a substring of $$$s$$$ which meets the following conditions:
- The length of $$$t$$$ is not less than $$$3$$$. Formally, $$$|t|\ge 3$$$.
- The first character of $$$t$$$ is $$$y$$$, and the other characters are $$$b$$$.
A substring of a string $$$s$$$ is a sequence $$$s_l, s_{l+1}, \dots, s_r$$$ for some integers $$$(l, r)$$$ such that $$$(1\le l\le r\le n),$$$ in which $$$n$$$ is the length of the string $$$s$$$.
The first line contains an integer $$$T(1\le T\le 100)$$$ — the number of test cases.
The first line of each test case contains an integer $$$n(1\le n\le 100)$$$ — the length of string $$$s$$$.
The second line contains a string $$$s$$$. It's guaranteed that $$$s$$$ consists only of lowercase English letters.
OutputFor each test case, output an integer in one line. — The number of $$$ybb$$$ substrings.
ExampleInput2 10 yybybbybbb 4 yabbOutput
3 0Note
In the test case $$$1$$$, there are $$$3$$$ $$$ybb$$$ substrings: $$$[s_4,s_5,s_6]$$$, $$$[s_7,s_8,s_9]$$$ and $$$[s_7,s_8,s_9,s_{10}]$$$, which are $$$ybb$$$, $$$ybb$$$ and $$$ybbb$$$ respectively.