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

    var max = 0
    for (i in 0 until N) {
        val s1 = S.substring(0..i)
        val s2 = S.substring(i + 1 until N)

        val s2dis = s2.toCharArray().distinct()
        max = Math.max(max,s1.toCharArray().distinct().filter{s2dis.contains(it)}.size)
    }
    println(max)
}


