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

import std.math;

void main() {
    auto cnt = new int[](5);
    int n;
    scan(n);
    foreach (i ; 0 .. n) {
        string s;
        scan(s);

        switch (s[0]) {
            case 'M':
            cnt[0]++;
            break;

            case 'A':
            cnt[1]++;
            break;

            case 'R':
            cnt[2]++;
            break;

            case 'C':
            cnt[3]++;
            break;

            case 'H':
            cnt[4]++;
            break;

            default:
            break;
        }
    }

    long ans;

    foreach (i ; 0 .. 5) {
        foreach (j ; i + 1 .. 5) {
            foreach (k ; j + 1 .. 5) {
                ans += 1L * cnt[i] * cnt[j] * cnt[k];
            }
        }
    }

    writeln(ans);
}


void scan(T...)(ref T args) {
    import std.stdio : readln;
    import std.algorithm : splitter;
    import std.conv : to;
    import std.range.primitives;

    auto line = readln().splitter();
    foreach (ref arg; args) {
        arg = line.front.to!(typeof(arg));
        line.popFront();
    }
    assert(line.empty);
}



void fillAll(R, T)(ref R arr, T value) {
    static if (is(typeof(arr[] = value))) {
        arr[] = value;
    }
    else {
        foreach (ref e; arr) {
            fillAll(e, value);
        }
    }
}
