import Data.List

solve :: String -> String -> [Int]
solve _ [] = []
solve a b = result : solve (a ++ [head b]) (tail b)
  where sa = nub $ sort a
        sb = nub $ sort b
        result = length $ filter (==True) [x == y | x <- sa, y <- sb]

main :: IO ()
main = do
  getLine
  s <- getLine
  print . maximum $ solve "" s