import Data.List

calc :: Int -> String -> Int -> Int
calc c s m
  | c == length s = m
  | otherwise = calc (c + 1) s nm
    where
      (a, b) = splitAt c s
      cm = length $ intersect (nub a) (nub b)
      nm = max cm m

main = do
  n <- readLn :: IO Int
  s <- getLine
  print $ calc 1 s 0
  