main = do
  n <- getLine
  s <- getLine
  putStrLn . show . solve $ s

solve :: String -> Int
solve s = maximum $ map (calc s) [1..(length s)]

calc s i = length $ filter (\c -> c `elem` (removeDup . (take i) $ s) && c `elem` (removeDup . (drop i) $ s)) ['a'..'z']

removeDup xs = helperRem [] xs
  where 
    helperRem seen [] = seen
    helperRem seen (x:xs) = if x `elem` seen then helperRem seen xs else helperRem (x:seen) xs