import Data.List (intersect, nub)

main = do
  n <- readLn
  s <- getLine
  print $ maximum $ map (solve s) [1..n-1]
  where
    solve :: String -> Int -> Int
    solve s i =
      let (xs, ys) = splitAt i s
      in
        length $ nub $ intersect xs ys