For this Question: Given a string S consisting of characters 'A' or 'B' only, you need to find the maximum length of substring consisting of character 'A' only.The first and the only line of input contains the string S.

Constraints
1 <= |S| <= 100000
S consists of characters 'A' or 'B' only.Output a single integer, the answer to the problem.Sample Input
ABAAABBBAA

Sample Output
3

Explanation: Substring from character 3-5 is the longest consisting of As only.

Sample Input
AAAA

Sample Output
4, I have written this Solution Code: import java.io.*;
import java.util.*;



class Main {
	public static void main (String[] args) throws IOException{

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String st = br.readLine();

		int len = 0;
		int c=0;
		for(int i=0;i<st.length();i++){
			if(st.charAt(i)=='A'){
				c++;
				len = Math.max(len,c);
			}else{
				c=0;
			}
		}
		System.out.println(len);
	}
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?