import Foundation

let n = Int(readLine()!)!
let s = readLine()!
var ss: [String] = []
var ans = 0
s.forEach { ss.append(String($0)) }
for i in 0..<n-1 {
  let s1 = ss[0...i]
  let s2 = ss[i+1...n-1]
  ans = max(Set(s1).intersection(Set(s2)).count, ans)
}
print(ans)