import Data.List
  
check a str = incheck $ splitAt a str
 where
  incheck (_,[]) = []
  incheck (x,y)  = inincheck x':(check (a+1) str)
   where
    x' = nub x
    inincheck [] = 0
    inincheck (k:ks)
     | elem k y = 1 + inincheck ks
     | otherwise= 0 + inincheck ks

main = do
 _ <- getLine
 str <- getLine
 print $ maximum $ check 1 str