import java.util.Scanner;
import scala.collection.immutable.Set;

object Main{
  def main(args: Array[String]){
    val sc = new Scanner(System.in);
    val n = sc.nextInt;
    sc.nextLine;
    val s: String = sc.nextLine;

    println((for(i <- 1 to s.length-1) yield {
      s.splitAt(i) match{
        case (f,s) => {
          (f.toCharArray.toSet & s.toCharArray.toSet).size;
        }
      }
    }).max);
  }
}
