fun main(args: Array<String>) {
    readInputLine()
    val s = readInputLine().toCharArray().toMutableList()
    
    val left = mutableListOf<Char>()
    
    var max = 0
    
    while (s.isNotEmpty()) {
        left.add(s.removeAt(0))
        
        val intersect = left.intersect(s).size
        
        if (intersect > max) {
            max = intersect
        }
    }
    
    println(max)
}

fun readInputLine(): String {
    return readLine()!!
}
