fun main(args: Array<String>) {
    abc098b()
}

fun abc098b() {
    val n = readLine()!!.toInt()
    val s = readLine()!!

    val answer = (1 until s.length).map {
        s.substring(0 until it).toList().intersect(s.substring(it until s.length).toList()).size
    }.max()

    println(answer)
}
