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

T read(T)() { return readln.chomp.to!T; }
T[] reads(T)() { return readln.split.to!(T[]); }
alias readint = read!int;
alias readints = reads!int;

void main() {
    int n = readint;
    auto a = new long[5];
    for (int i = 0; i < n; i++) {
        auto s = read!string;
        switch (s[0]) {
        case 'M': a[0]++; break;
        case 'A': a[1]++; break;
        case 'R': a[2]++; break;
        case 'C': a[3]++; break;
        case 'H': a[4]++; break;
        default: break;
        }
    }

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