import std.stdio;
import std.conv;
import std.algorithm;
import std.string;
import std.array;

void main() {
    int n = readln.chomp.to!int;
    string[] s = new string[](n);
    char[5] initial = ['M', 'A', 'R', 'C', 'H'];
    long[5] num;

    for (int i = 0; i < n; ++i) {
        s[i] = readln.chomp;
        
        for (int j = 0; j < 5; ++j) {
            if (s[i][0] == initial[j]) {
                num[j]++;
                break;
            }
        }
    }

    long ans;

    for (int i = 0; i < 5; ++i) {
        for (int j = i + 1; j < 5; ++j) {
            for (int k = j + 1; k < 5; ++k) {
                ans += (num[i] * num[j] * num[k]);
            }
        }
    }

    writeln(ans);

    return;
}