import Control.Applicative ((<$>), (<*>))
import Data.List (intersect, nub)

main :: IO ()
main = solve <$> readLn <*> getLine >>= print

solve :: Int -> String -> Int
solve n ss = maximum . map f $ [1..n-1]
  where f i = length $ nub $ intersect as bs
          where (as, bs) = splitAt i ss
