import java.util.*

val sc = Scanner(System.`in`)
val N = sc.nextInt()
val S: String = sc.next()

fun main(args: Array<String>) {
    var ans = 0

    for (i in 0 until N) {
        val x = S.slice(0..i).toSet()
        val y = S.slice(i + 1 until N).toSet()

        var cnt = 0
        for (c in 'a'..'z') {
            if (c in x && c in y) {
                cnt++
            }
        }
        ans = Math.max(ans, cnt)
    }
    println(ans)
}
