import qualified Data.Set as DS
main = do
  getLine 
  s <- getLine 
  print $ solve s 0

solve :: String -> Int -> Int
solve str n = 
  if n == length str then 0 
  else
    max (DS.size (DS.intersection s1 s2)) (solve str (n+1))
      where (l,r) = splitAt n str
            s1 = DS.fromList l
            s2 = DS.fromList r
