#C5499. Longest Contiguous 'A' Segment
Longest Contiguous 'A' Segment
Longest Contiguous 'A' Segment
Given a string s
that contains only the characters 'A' and 'B', your task is to compute the length of the longest contiguous segment of 'A's in the string.
For example, in the string "AAABBA", the longest contiguous segment of 'A's is of length 3. In the string "BBBAAAAB", the longest segment is 4.
The solution should read the input string from stdin and output the result to stdout.
inputFormat
The input consists of a single line containing a string s
that includes only the characters 'A' and 'B'. Note that s
may be empty.
Input is read from stdin.
outputFormat
Output a single integer denoting the length of the longest contiguous segment of 'A's. The output should be written to stdout.
## sampleAAABBA
3