object Main extends App {
	val n = scala.io.StdIn.readInt
	var s = scala.io.StdIn.readLine.toList
	var a = Set[Char]()
	var b = Set[Char]()

	var ans = 0
	var cnt = 0
	for(i<-0 until n){
		a = a + s.head
		s = s.tail


		for(x <- a){
			if(s.contains(x)){
				cnt += 1
				b = b + x
			}
		}

		a = b
		ans = math.max(ans, cnt)
		cnt = 0
	}

	println(ans)
}
