Function to find largest string which satisfy condition
static int CountTotal ( String str ) { int ans = 0 ; int n = str . length ( ) ; char [ ] s = str . toCharArray ( ) ; int cnt = 0 ; for ( int i = 0 ; i < n ; i ++ ) {