import scala.io.StdIn

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