object Main extends App{
    val n = scala.io.StdIn.readInt
    val s = scala.io.StdIn.readLine
    
    val output = (1 until n).map(e => (s.take(e).distinct, s.drop(e).distinct)).map(e => e._1 intersect e._2).map(_.length).max
    println(output)
}
