Longest Run of X's

No attempts yetTime limit1sMemory limit256 MB

Problem

Gru and Lucy are breaking into El Macho's lair. In front of them is a hallway that may be booby-trapped. The hallway is a single row of squares, and every square is marked either X or O. Gru believes that only the squares in the longest run of consecutive X marks are safe.

For each hallway, count how many squares are safe.

Input

The first line contains the number of test cases TT. TT is less than 100.

Each of the following lines holds one test case. The first number on the line is the number of squares nn, followed by nn strings separated by spaces. Each string is either X or O.

nn is at least 1, and the sum of nn over all test cases is at most 200000.

Output

For each test case, find the length LL of the longest run of consecutive X marks and print one line in this format.

The longest contiguous subsequence of X's is of length L

Write LL as a plain integer. If the hallway has no X at all, LL is 0.