
main = do
    (n:_) <- (fmap read . words) <$> getLine
    str <- getLine

    -- break list
    let numList b = [(isElem c $ take b str) && (isElem c $ drop b str) | c<-['a'..'z']]
    let ansList = [count True $ numList b | b<-[1..n] ]
    print $ maximum ansList


count :: Eq a => a -> [a] -> Int
count c = length . filter (c==)

isElem :: Eq a => a -> [a] -> Bool
isElem _ [] = False
isElem c (x:xs)
    | c==x = True
    | otherwise =isElem c xs 