import java.math.BigDecimal
import java.util.*

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

    val counts = IntArray(5)
    while (sc.hasNext()) {
        val line = sc.nextLine().trim()
        if (line.isNotEmpty()) {
            when (line[0]) {
                'M' -> ++counts[0]
                'A' -> ++counts[1]
                'R' -> ++counts[2]
                'C' -> ++counts[3]
                'H' -> ++counts[4]
            }
        }
    }

    var ret = BigDecimal(0)

    for (i in 0 until 5 - 2) {
        for (j in i + 1 until 5 - 1) {
            for (k in j + 1 until 5 - 0) {
                val bi = BigDecimal(counts[i])
                val bj = BigDecimal(counts[j])
                val bk = BigDecimal(counts[k])
                ret = ret.add(bi.multiply(bj).multiply(bk))
            }
        }
    }

    println(ret)
}
