function myout(text){console.log(text);}//standard output
function Main(input) {
	//input = parseInt(input);
	//input = input.trim().split(" ");
	input = input.split("\n");
	//input = input.trim().split(" ").map((a)=>Number(a));
	//input = input.trim().split("\n").map((a)=>Number(a));
  var N = parseInt(input[0]);
  var S = input[1];
  var alpha = "abcdefghijklmnopqrstuvwxyz".split("");
  var output = 0;
  for(var i = 1; i < S.length; i++){
    var X = S.slice(0,i);
    var Y = S.slice(i,S.length);
    var count = 0;
    for(var j = 0; j < alpha.length; j++){
      if(X.indexOf(alpha[j]) != -1 && Y.indexOf(alpha[j]) != -1){
         count++;
      }
    }
    output = Math.max(count,output);
  }
  myout(output);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());
