object Main extends App {
val n = scala.io.StdIn.readInt
val s = scala.io.StdIn.readLine

var max_cnt = 0
for (i<-0 to n) {
  val mae = s.take(i).distinct.toList
  val ato = s.drop(i)
    
  var cnt = 0
  for (m <- mae) {
      if (ato.indexOf(m)>=0) cnt += 1
  }
  if (cnt > max_cnt) max_cnt = cnt
}
    println(max_cnt)
}