import Data.List
az = ['a'..'z']
main = do
    n <- readLn
    s <- getLine
    print $ maximum $ map (test s) [1..n-1]
test s n =
    length $ az \\ (az \\ intersect a b)
      where
        (a, b) = splitAt n s