import java.util.Scanner

object Main {
  def main(args: Array[String]): Unit = {
    val sc = new Scanner(System.in)
    val n = sc.nextInt()
    val a = Array(0L, 0L, 0L, 0L, 0L) // m a r c h
    for(i <- 0 until n) {
      val s = sc.next()
      if (s.charAt(0) == 'M') {
        a(0) += 1
      } else if (s.charAt(0) == 'A') {
        a(1) += 1
      } else if (s.charAt(0) == 'R') {
        a(2) += 1
      } else if (s.charAt(0) == 'C') {
        a(3) += 1
      } else if (s.charAt(0) == 'H') {
        a(4) += 1
      }
    }
    var ans = 0L
    for(i <- 0 until a.length) {
      for(j <- (i+1) until a.length) {
        for(k <- (j+1) until a.length) {
          ans += a(i)*a(j)*a(k)
        }
      }
    }
    println(ans)
  }
}
