object Main extends App {
  @scala.annotation.tailrec
  def loop(l: List[Char], r: Seq[Char], max: Int): Int = r match {
    case Seq() => max
    case y :: ys => loop(y :: l, ys, (y :: l).distinct.count(r.distinct.contains).max(max))
  }

  val sc = new java.util.Scanner(System.in)
  val _, S = sc.next()
  println(loop(List.empty, S.toCharArray.toList, 0))
}
