fun main(args: Array<String>) {
    val N = readLine()!!.toInt()
    val S = readLine()!!

    val ans = (1..N-1).map {
        val c1 = S.substring(0,it).toCharArray()
        val c2 = S.substring(it).toCharArray().asList()
        c1.intersect(c2).size
    }.max()
    println(ans)
}