import Control.Monad
conb::(x,x,x,x,x)->[[x]]
conb (a,b,c,d,e) = [[a,b,c],[a,b,d],[a,b,e],[a,c,d],[a,c,e],[a,d,e],[b,c,d],[b,c,e],[b,d,e],[c,d,e]]

eater::(Integer,Integer,Integer,Integer,Integer)->[String]->(Integer,Integer,Integer,Integer,Integer)
eater (m,a,r,c,h) []         = (m,a,r,c,h)
eater (m,a,r,c,h) ((x:_):xs) = case x of
                              'M' -> eater (m+1,a,r,c,h) xs
                              'A' -> eater (m,a+1,r,c,h) xs
                              'R' -> eater (m,a,r+1,c,h) xs
                              'C' -> eater (m,a,r,c+1,h) xs
                              'H' -> eater (m,a,r,c,h+1) xs
                              otherwise -> eater (m,a,r,c,h) xs

solver::[String]->Integer
solver ss = let vec = eater (0,0,0,0,0) ss in
            sum (map product (conb vec))

main::IO()
main=do
  nc<-getLine
  let n = read nc ::Int
  ss<-forM [1..n] (\_->getLine)
  print (solver ss)