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

    var max = 0

    for (i in 1..(n - 1)) {
        val s1 = s.substring(0, i).toSet()
        val s2 = s.substring(i, n).toSet()

        val count = s1.count { s2.contains(it) }
        max = if (count > max) count else max
    }

    println(max)
}