private static int getMax(String s, int start) 
    {
    	char color = 'x';
    	int cur;
    	for (cur=start; cur<s.length(); cur++) {
    		char bead = s.charAt(cur);
    		if (bead != 'w') {
    			if (color == 'x')
    				color = s.charAt(cur);
    			else if (bead != color)
    				break;
    		}
    	}
    	
    	color = 'x';
    	for (; cur<s.length(); cur++) {
    		char bead = s.charAt(cur);
    		if (bead != 'w') {
    			if (color == 'x')
    				color = s.charAt(cur);
    			else if (bead != color)
    				break;
    		}    		
    	}
    	
    	int ans = cur - start;
    	return Math.min(ans, s.length()/2);
    }