Prim is a programmer who loves finding ways to become more productive. Recently, she has discovered that when typing on her keyboard, she is able to type words entirely with her left hand. When this happens, she is able to use the mouse with her right hand which greatly speeds up her workflow.
Prim has asked for your help to look at the list of phrases she most commonly types and identify the longest stretch of letters that she can type entirely with her left hand. Prim can type a letter with her left hand if it appears left of the characters 'T', 'G', 'B', inclusive, on her QWERTY keyboard.
Input Specification
The first line of input contains an integer , the number of characters in a phrase that Prim would like to you analyze. The next line contains a string with upper-case letters, the phrase that Prim would like you to analyze.
For 40 of the 100 points, .
Output Specification
Output the length of the longest segment of the phrase that Prim can type with her left hand.
Sample Input 1
10
HELLOWORLD
Sample Output 1
1
Sample Input 2
30
STEWARDSATASECRETSTARCRAFTFEST
Sample Output 2
30
Comments