import kotlin.math.max

fun main(args: Array<String>) {
    val n = readInt()
    val s = readString()

    var ans = 0
    for (i in 1 until n) {
        val l = s.subSequence(0, i).toList()
        val r = s.subSequence(i, n).toList()
        val size = l.intersect(r).size
        ans = max(ans, size)
    }
    println(ans)
}

// Tools
fun readString() = readLine()!!
fun readInt() = readLine()!!.toInt()