
fun main(args:Array<String>) {
    val n = readLine()!!.toInt()
    val s = readLine()!!
    val ans = (1 until n).map {idx->s.substring(0 until idx).toSet().filter { s.substring(idx).contains(it) }.count()}.max()
    println(ans)
}