Diseased String
题号:NC232081
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

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, .
  • The first character of t is y, and the other characters are b.
You should count the number of ybb substrings.
A substring of a string s is a sequence for some integers (l, r) such that in which n is the length of the string s.

输入描述:

The first line contains an integer  --- the number of test cases.
The first line of each test case contains an integer --- the length of string s.
The second line contains a string s. It's guaranteed that s consists only of lowercase English letters.

输出描述:

For each test case, output an integer in one line. --- The number of ybb substrings.
示例1

输入

复制
2
10
yybybbybbb
4
yabb

输出

复制
3
0

说明

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.