import scala.io.StdIn

object Main extends App {
  val n = StdIn.readLine.toInt
  val s = StdIn.readLine
  val res = for {
    i <- 1 until s.length()
  } yield {
    val ar = s.toArray.splitAt(i)
    (ar._1 intersect ar._2).distinct.length
  }
  println(res.max)
}