import scala.io.StdIn._

object Main extends App {
  val n = readInt()
  val s = readLine()
  
  val result = (1 until n).map { i =>
    s.take(i).toSet.intersect(s.substring(i).toSet).size
  }.max
  
  println(result)
}