import java.util.Scanner

object Main {
  def solve(S: String) = {
    (S.indices map { i =>
      val (x, y) = S.splitAt(i)
      (x.toCharArray.distinct intersect y.toCharArray.distinct).size
    }).max
  }

  def main(args: Array[String]): Unit = {
    val sc = new Scanner(System.in)
    val N = sc.nextInt()
    println(solve(sc.next()))
  }
}
