fun main(args: Array<String>){
    val N: String = kotlin.io.readLine() ?: return
    val n = Integer.parseInt(N)
    var a = longArrayOf(0, 0, 0, 0, 0)
    var ans: Long = 0
    for(i in 1..n){
        val s = kotlin.io.readLine() ?: return
        when(s[0]){
            'M' -> a[0]++
            'A' -> a[1]++
            'R' -> a[2]++
            'C' -> a[3]++
            'H' -> a[4]++
        }
    }
    for(i in a.indices){
        for(j in a.indices){
            if(i == j) continue
            for(k in a.indices){
                if(i == k || j == k) continue
                ans += a[i] * a[j] * a[k]
            }
        }
    }
    println(ans/6)
}