const main = function(input){
  var str = input.split("\n")[1];
  var len = str.length;
  var max = 0;

  for(var i=0;i<len;i++){
  	var left = str.slice(0,i);
    var right = str.slice(i,len);
    var count = 0;
    var countedCode=[];
    for(var j=0;j<left.length;j++){
    	var code = left[j].charCodeAt();
        if(countedCode.indexOf(code)>=0)continue;
        countedCode.push(code);
        for(var k=0;k<right.length;k++){
        	var rcode = right[k].charCodeAt();
          	if(code===rcode){
              count++;
          	  break;
            }
        }
      if(max<count) max = count;
    }
  }
  console.log(max);
  
}


main(require('fs').readFileSync('/dev/stdin', 'UTF-8'));