import Control.Monad
import Text.Printf
import Control.Applicative
import Data.List

main :: IO()
main = do
  n <- getLine
  s <- getLine
  printf "%s" $ slv s

slv :: String -> String
slv s = show $ calc len s 0
  where len = length s

calc :: Int -> String -> Int -> Int
calc 0 _ ret = ret
calc n s ret = calc (n - 1) s (max ans ret)
  where ans = countStr alpha sl sr 0
        (sl, sr) = splitAt n s

alpha = "abcdefghijklmnopqrstuvwxyz"

countStr :: String -> String -> String -> Int -> Int
countStr [] _ _ ret = ret
countStr (c:cs) sl sr ret | elem c sl && elem c sr = countStr cs sl sr (ret+1)
                          | otherwise = countStr cs sl sr ret