import Data.List
import Control.Monad

count :: Int -> String -> String -> Int
count acc [] ls = acc
count acc (x:xs) ls = if x `elem` ls then count (acc+1) xs ls' else count acc xs ls'
	where
		ls' = nub ls

main = do
	line <- fmap (\x -> read x :: Int) getLine
	str <- getLine
	counts <- forM [1..(line-1)] $ \x -> do
		let split = splitAt x str
		return $ count 0 (nub (fst split)) (snd split)
	putStrLn $ show $ maximum counts