import std.stdio;
import std.conv;
import std.string;
import core.bitop;

void main()
{
    auto N = readln.chomp.to!long;
    immutable march = "MARCH";
    long[march.length] list;

    foreach (_; 0 .. N)
    {
        auto name = readln();
        foreach (i, c; march)
        {
            if (name[0] == c)
            {
                list[i]++;
            }
        }
    }
    long nonzero;
    byte mask;
    foreach (i, n; list)
    {
        if (n != 0)
        {
            mask |= 1 << i;
            nonzero++;
        }
    }

    long result;

    foreach (comb; 0b0 .. 0b111111)
        if ((comb & mask) == comb && popcnt(comb) == 3)
        {
            long tmp = 1;
            foreach (i, n; list)
                if ((comb & (1 << i)) != 0)
                {
                    tmp *= n;
                }
            result += tmp;
        }
    writeln(result);
}
