import java.io.BufferedReader
import java.io.PrintWriter

var out: PrintWriter = PrintWriter(System.out)  // これを使って出力すると早い

fun main(args: Array<String>) {
    try {
        val charCount =
            mutableMapOf(*charArrayOf('M', 'A', 'R', 'C', 'H').map { Pair(it, 0) }.toTypedArray())

        val n = MyScanner.readAsInt()

        for (i in 1..n) {
            val head = MyScanner.readAsString().first()
            if (charCount.containsKey(head)) {
                charCount[head] = charCount[head]!! + 1
            }
        }

        val target = charCount.filter { it.value > 0 }.map { it.value }

        if (target.count() <= 2) {
            out.println(0)
            return
        }

        var score = 0L
        for (i in 0 until target.count() - 2) {
            for (j in (i + 1) until target.count() - 1) {
                for (k in (j + 1) until target.count()) {
                    score += target[i].toLong() * target[j] * target[k]
                }
            }
        }
    

        out.println(score)
    } finally {
        out.flush()   // 消さない
    }
}

/**
 * 読み取り
 */
class MyScanner {
    companion object {
        private var reader: BufferedReader = System.`in`.bufferedReader()

        fun reset() {
            reader = System.`in`.bufferedReader()
        }

        fun readAsInt(): Int {
            return Integer.parseInt(reader.readLine())
        }

        // Int
        fun readAsIntArray(delimiters: String = " "): IntArray {
            return reader
                .readLine()
                .split(delimiters)
                .map { s -> Integer.parseInt(s) }
                .toIntArray()
        }

        fun readNTimesAsInt(n: Int): IntArray {
            return (1..n).map { readAsInt() }.toIntArray()
        }

        fun readNTimesAsIntArray(n: Int): Array<IntArray> {
            return (1..n).map { readAsIntArray() }.toTypedArray()
        }

        // long
        // TODO 別の方法を考える
        fun readAsLong(): Long {
            return reader.readLine().toLong()
        }

        fun readAsLongArray(delimiters: String = " "): LongArray {
            return reader.readLine()
                .split(delimiters)
                .map { s -> s.toLong() }
                .toLongArray()
        }

        fun readNTimesAsLong(n: Int): LongArray {
            return (1..n).map { readAsLong() }.toLongArray()
        }

        fun readAsString(): String {
            return reader.readLine()
        }

        fun readAsStringArray(delimiters: String = " "): Array<String> {
            return readAsString().split(delimiters).toTypedArray()
        }

    }
}

/**
 * 要素とその個数を出力
 */
fun <T> Array<T>.ofCountMap(): Map<T, Int> {
    return this.groupBy { it }.mapValues { it.value.count() }
}

/**
 * 文字とその個数を出力
 */
fun String.ofCountMap(): Map<Char, Int> {
    return this.toCharArray().ofCountMap()
}

/**
 * 文字とその個数を出力
 */
fun CharArray.ofCountMap(): Map<Char, Int> {
    return this.groupBy { it }.mapValues { it.value.count() }
}

/**
 * Combination, nCk mod p を求める
 * https://ja.wikipedia.org/wiki/%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%A9%E9%80%86%E6%95%B0
 * http://drken1215.hatenablog.com/entry/2018/06/08/210000
 * @param maxN 最大のn
 * @param mod 素数p
 */
class ModCombination(private val maxN: Int, private val mod: Int = 1000000007) {
    val fac: IntArray = IntArray(maxN)
    val finv: IntArray = IntArray(maxN)

    init {
        val inv: IntArray = IntArray(maxN)
        fac[0] = 1
        fac[1] = 1

        inv[0] = 1
        inv[1] = 1
        for (i in 2..maxN) {
            fac[i] = fac[i - 1] * i % mod   // 累積
            // mod % i < i
            inv[i] = mod - ((inv[mod % i].toLong()) * (mod / i) % mod).toInt()
            finv[i] = finv[i - 1] * inv[i] % mod
        }
    }

    /**
     * nCk mod p
     */
    fun Calc(n: Int, k: Int): Int {
        if (n < k || n < 0 || k < 0) {
            return 0
        }

        return ((fac[n].toLong() * finv[k] % mod) * finv[n - k] % mod).toInt()
    }
}

Measured memory_bytes: 36860