import Data.List (subsequences, nub)

main :: IO ()
main = do
  _ <- getLine
  s <- getLine
  print $ (length . allSubseq) s - 1

allSubseq :: String -> [String]
allSubseq str = filter beColorful (subsequences str)

beColorful :: String -> Bool
beColorful str = nub str == str