import java.util.*

fun main(args: Array<String>) {
    val pw = java.io.PrintWriter(System.out)
    Problem.solve(Scanner(System.`in`), pw)
    pw.flush()
}

object Problem {
    fun solve(sc: Scanner, pw: java.io.PrintWriter) {
        val N = sc.next().toInt()
        val S = mutableMapOf<Char, Long>()
        repeat(N) {
            val c = sc.next().toCharArray()[0]
            S[c] = (S[c] ?: 0) + 1
        }
        var ans = 0L
        val m = arrayOf(
            (S['M'] ?: 0),
            (S['A'] ?: 0),
            (S['R'] ?: 0),
            (S['C'] ?: 0),
            (S['H'] ?: 0)
        )
        for (i in 0 until 3) for (j in i + 1 until 4) for (k in j + 1 until 5) {
            ans += m[i] * m[j] * m[k]
        }
        pw.println(ans)
    }
}
