import Data.List

main :: IO ()
main = do
  n <- readLn
  s <- getLine
  print $ solve n s

solve :: Int -> String -> Int
solve n s = maximum [ solve' i s | i <- [0 .. n] ]

solve' :: Int -> String -> Int
solve' i s = length $ nub $ uncurry intersect $ splitAt i s