function Main(s){
  s = s.split("\n");
  var n = +s[0];
  s = s[1];
  var ans = 0;
  var m = 0;
  var x = "";
  var f = 1;
  for(var i = 1; i < n; i++){
    for(var j = 0; j < i; j++){
      for(var k = 0; k < x.length; k++){
        if(x[k] === s[j])f = 0;
      }
      if(f)
      for(var k = i; k < n; k++){
        if(s[j] === s[k]){
          x += s[j];
          m++;
          break;
        }
      }
      f = 1;
    }
    ans = Math.max(ans, m);
    m = 0;
    x = "";
  }
  console.log(ans);
}

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