package bishi;
import java.util.HashMap;
import java.util.Scanner;
public class two {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String str = sc.nextLine();
HashMap map = new HashMap<>();
map.put('a', 0);map.put('b', 1);map.put('c', 2);map.put('x', 3);map.put('y', 4);map.put('z', 5);
int max = 0;
int len = str.length();
int[][] sum = new int[len + 2][10];
for(int i = 1; i <= len; i++){
char c = str.charAt(i - 1);
if(check(c)){
int index = map.get(c);
for(int j = 0; j
if(index == j){
sum[i][j] = sum[i - 1][j] + 1;
} else {
sum[i][j] = sum[i - 1][j];
}
}
} else {
for(int j = 0; j
sum[i][j] = sum[i - 1][j];
}
}
}
// for(int i = 0; i <= len; i++){
// System.out.println("==============i = " + i + "=============");
// for(int j = 0; j
// System.out.print(sum[i][j]);
// }
// System.out.println();
// }
for(int i = 1; i <= len; i++){
for(int j = i + max; j <= len; j++){
boolean flag = true;
for(int k = 0; k
int val = sum[j][k] - sum[i - 1][k];
if((val & 1) == 1){
flag = false;
break;
}
}
if(flag){
max = Math.max(max, j - i + 1);
}
}
}
System.out.println(max);
}
public static boolean check(char c){
return c == 'a' || c == 'b' || c == 'c' || c == 'x' || c == 'y' || c == 'z';
}
}
第三题直接没做