object Main {
  def main(args:Array[String]) = {
    val sc = new java.util.Scanner(System.in)
    val n = sc.nextInt
    val s = sc.next

    println(
      (1 to n - 1)
        .map(i =>
          s.slice(0, i)
            .toSet
            .intersect(s.slice(i, n).toSet)
            .size
        ).max
    )
  }
}
