import scala.io.StdIn

object Main extends App {
  val n = StdIn.readLine().toInt
  val linse = (0 until n).map(_ => StdIn.readLine())
  
  val combis = "MARCH".split("").combinations(3).map(p => p.toList)
  
  val members = linse.filter{p => 
    p.charAt(0) == 'M' || p.charAt(0) == 'A' || p.charAt(0) == 'R' || p.charAt(0) == 'C' || p.charAt(0) == 'H'
  }.groupBy(name => name.charAt(0))
  
  //val combi = members.keys.toList.combinations(3)
  //println(combi.mkString(" "))
  
  val result = combis.foldLeft(0L){ (acc, l) =>
    val List(a1, a2, a3) = l.map(p => p.charAt(0))
    acc + members.getOrElse(a1, List()).size * members.getOrElse(a2, List()).size * members.getOrElse(a3,List()).size 
  }

  println(result)

}