import Control.Monad
import Data.List
import Data.Set

main = do
    n <- readLn :: IO Int
    s <- getLine
    print $ maximum $ Data.List.map (chk s) [1..n-1]
    where chk s i = let (ls,rs) = splitAt i s
                  in size $ intersection (fromList ls) (fromList rs)
        
        