import java.util.Scanner; import java.io.PrintStream; public class Shots { public static void main(String[] args) { Scanner in = new Scanner(System.in ); PrintStream out = System.out; final int N = in.nextInt(); // number of test cases String s = in.nextLine(); // get rid of carriage return at end of line for (int n = 0; n < N; n++) { // process each test case s = in.nextLine(); int count = 0; // how many successes in a row currently seen int maxcount = 0; // max number of successes in a row ever seen for (int i = 0; i < 25; i++) { if (s.charAt(i) == 'M') count = 0; // reset count else { count++; if (count > maxcount) maxcount = count; } } out.println("Player " + (n+1) + ": " + maxcount); } } }