import qualified Data.Map as M

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

solve :: String -> Int
solve = pred . M.foldr (*) 1 . M.map succ . count

count :: String -> M.Map Char Int
count [] = M.empty
count (c:cs) = M.insertWith (+) c 1 $ count cs