import java.util.*

fun main(args: Array<String>) {
  val sc = Scanner(System.`in`)
  val n = sc.nextInt()
  val s = sc.next()

  var max = 0
  for (i in 1 until n) {
    val sub1 = s.substring(0, i)
    val sub2 = s.substring(i, n)

    var tmp = 0
    for (c in 'a'..'z') {
      if (sub1.contains(c) && sub2.contains(c)) {
        tmp++
      }
    }
    max = Math.max(tmp, max)
  }
  println(max)
}
