import Data.List
import Data.Ord
import Data.Char
import Data.Ratio
import Data.Maybe
import Control.Monad

main = do
  getLine
  s <- getLine
  print $cutAndCount s

cutAndCount list = maximum $cutAndCount' 1 list
cutAndCount' n list
  |(length list)/=n = (length .nub .intersect left) right : cutAndCount' (n+1) list
  |otherwise = []
    where left  = take n list
          right = drop n list