K. Chain of Suspicion
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

A suspicious string is a string of the form s$$$^n$$$u$$$^n$$$s$$$^n$$$ for $$$n \gt 0$$$. In other words, a suspicious string is made up of $$$n$$$ copies of the letter s, followed by $$$n$$$ copies of the letter u, and then another $$$n$$$ copies of the letter s. So sus and sssuuusss are examples of suspicious strings, but suuus and sssuus are not.

A chain of suspicion is a concatenation of zero or more suspicious strings. For example, the empty string, sus, and susssuusssus are chains of suspicion, and susus and sssusss are not.

Given a string $$$t$$$ consisting of the letters s and u, print the length of the longest (possibly empty) substring that is a chain of suspicion.

Input

The first line of the input contains a single integer $$$t$$$ ($$$1\le t\le 10^4$$$) — the number of test cases.

The first line of each test case contains a single integer $$$n$$$ ($$$1\le n \le 2\cdot 10^5$$$) — the length of $$$t$$$.

The second line of each test case contains $$$n$$$ characters, each of which is either s or u — the string $$$t$$$.

It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2\cdot 10^5$$$.

Output

For each test case, output one line containing a single integer — the length of the longest substring of $$$t$$$ that is a chain of suspicion.

Example
Input
4
2
us
3
sus
6
suussu
13
susususssuuss
Output
0
3
0
9
Note

In the first test case, the only substring of $$$t$$$ that is a chain of suspicion is the empty string, so the answer is $$$0$$$.

In the second test case, $$$t$$$ itself is a chain of suspicion, so the answer is $$$3$$$.

In the fourth test case, the longest substring of $$$t$$$ that is a chain of suspicion is susssuuss.