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 {
    (s.substring(0,i) intersect s.substring(i,n))
    .distinct.length
  }
  println(res.max)
}