#K46527. Maximum Consecutive Safe Houses
Maximum Consecutive Safe Houses
Maximum Consecutive Safe Houses
You are given several test cases, each containing a string representing a hiking route where each character is either 'S' (a safe house) or 'D' (danger). Your task is to find the maximum number of consecutive safe houses ('S') in each route.
Input Format: The first line contains an integer t representing the number of test cases. The following t lines each contain a single string describing a hiking route.
Output Format: For each test case, output the maximum number of consecutive safe houses on its own line.
Note: The input is read from standard input (stdin) and the output should be written to standard output (stdout).
inputFormat
The first line of input contains an integer t (1 ≤ t ≤ 1000), the number of test cases. Each of the next t lines contains a non-empty string representing a hiking route consisting only of the characters 'S' and 'D'.
outputFormat
For each test case, print a single integer representing the maximum number of consecutive safe houses ('S') encountered in the route. Each answer should be printed on a new line.
## sample3
SSSDSS
DSSDSDSSS
SSSSD
3
3
4
</p>