import scala.io.StdIn._
object Main extends App {
  val n = readInt
  var map = Map('M' -> 0, 'A' -> 0, 'R' -> 0, 'C' -> 0, 'H' -> 0)
  for (_ <- 1 to n) {
    val c = readLine()(0)

    map.get(c) match {
      case Some(i) => map = map + (c -> (i + 1))
      case None    =>
    }
  }

  val res = "MARCH".toSeq.combinations(3).foldLeft(0) { (acc, s) =>
    acc + (map(s(0)) * map(s(1)) * map(s(2)))
  }
  println(res)
}
