import java.util.Scanner

object Main {
  val sc = new Scanner(System.in)
  def main(args: Array[String]) {
    sc.next
    val s = sc.next
    val n = s.length
    println(1.until(n).map(
      i => s.splitAt(i)
    ).map({
      case (l, r) => l.count(x => r.contains(x))
    }).max)
  }
}
