import scala.io.{StdIn => in}

object Main extends App {

  val n = in.readInt
  val tar ="MARCH".toCharArray
  val table = Array.ofDim[Int](tar.size)

  Iterator.continually(in.readLine)
    .take(n)
    .foreach(s => {
      val idx = tar.indexWhere(_ == s.head)
      if(idx != -1) table(idx) += 1
    })

    // debug(table.mkString(" "))

  val ans = {
    var res = 0
    for {
      i <- tar.indices
      j <- i+1 until tar.size
      k <- j+1 until tar.size
    } res += table(i) * table(j) * table(k)
    res
  }
  println(ans)

  def debug(any:Any*):Unit = {
    if(this.getClass.toString == "class Main$") return
    println(any.mkString(" "))
  }
}