import java.util.*

fun main(args: Array<String>) {
  val sc = Scanner(System.`in`)
  val n = sc.nextInt()
  val s = (1..n).map { sc.next() }

  val map = mutableMapOf<Char, Long>()
  for (si in s) {
    val c = si[0]
    if (c == 'M' || c == 'A' || c == 'R' || c == 'C' || c == 'H') {
      val tmp = map.getOrElse(c) { 0 }
      map.put(c, tmp+1)
    }
  }

  val size = map.values.size
  if (size <= 2) {
    println(0)
    return
  }

  var ans = 0L
  val list = map.values.toList()
  for (i in 0 until size) {
    val si = list[i]
    for (j in i+1 until size) {
      val sj = list[j]
      for (k in j+1 until size) {
        val sk = list[k]
        ans += si * sj * sk
      }
    }
  }

  println(ans)

}