sameElem::[Char]->[Char] -> [Char]
sameElem a b = [x|x<-['a'..'z'], elem x a && elem x b]
sameCount::[Char]->Int->Int
sameCount xs n = do
    let (a, b) = splitAt n xs
    length $ sameElem a b
mapdeath::[Char]->[Int]->[Int]
mapdeath s= map (sameCount s)
abc098b = do
    n <- readLn::IO Int
    s <- getLine::IO [Char]
    let res = mapdeath s [0..n]
    print $ maximum res
main = abc098b