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

void main(){
    auto num = readln.chomp.to!int;
    string[] persons;
    for(auto i = 0; i < num; i++){
        persons ~= readln.chomp;
    }
    long[string] groups;
    groups.divide_march(persons);
    auto combinations = [
        "MAR","MAC","MAH","MRC","MRH","MCH",
        "ARC","ARH","ACH",
        "RCH"
    ];
    long answer = 0;
    combinations.each!((comb){
        long temp = groups[""~comb[0]] * groups[""~comb[1]] * groups[""~comb[2]];
        answer += temp;
    });
    writeln(answer);
}

void divide_march(ref long[string] groups, string[] persons){
    "MARCH".each!((c){
        auto index = ""~c;
        groups[index] = persons.filter!((p) => p[0] == c).array.length;
    });
}