import Data.List
{-

-}
main = do
    n <- getLine >>= return . read 
    strlist <- sequence . take n $ repeat getLine
    let initials = map (\xs -> (head xs) : "") strlist
    let ans = solve initials
    print ans

solve :: [String] -> Integer
solve initials = m*a*r + m*a*c + m*a*h + m*r*c + m*r*h + m*c*h + a*r*c + a*r*h + a*c*h + r*c*h
    where m = count "M" initials
          a = count "A" initials
          r = count "R" initials
          c = count "C" initials
          h = count "H" initials

count :: String -> [String] -> Integer
count search list = toInteger . length $ [e | e <- list, e == search]
