import Data.List

main = do
  n <- fmap read getLine
  s <- getLine
  print $ maximum $ map (\i -> let (s1, s2) = splitAt (i-1) s in (let tmp = sort (nub s1) ++ sort (nub s2) in length tmp - length (nub tmp))) [2..n]