import qualified Data.ByteString.Char8 as B
import qualified Data.Map as MP
import Data.Bits
import Data.List
import Control.Monad

update :: MP.Map Char Int -> B.ByteString -> MP.Map Char Int
update m bs 
    | h  `elem` "MARCH" = MP.adjust (+1) h m
    | otherwise = m
    where
        h = B.head bs

enum :: Int -> Int -> [Int]
enum n l
    | l == 0 = []
    | otherwise = (n .&. 1) : enum (shiftR n 1) (l - 1)

solve :: [Int] -> Int
solve es = sum $ map (\i -> comb es (enum i 5)) [0..31]
    where
        comb :: [Int] -> [Int] -> Int
        comb es ens 
            | (length $ elemIndices 1 ens) /= 3 = 0
            | otherwise = foldl' step 1 $ zip es ens
                where
                    step acc (v, b)
                        | b == 1 = acc * v
                        | otherwise = acc

main = do
    n <- readLn :: IO Int
    names <- replicateM n B.getLine
    let m = foldl' (\m i -> MP.insert i 0 m) MP.empty "MARCH"
    let es = MP.elems $ foldl' update m names
    print $ solve es