#include"bits/stdc++.h"

using namespace std;
long long C[9], V[99];
long long N;
long long cnt;
char A[15];

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	cin >> N;

	while(N--){
		cin >> A;
		V[A[0]]++;
	}
	C[0] = V['M'];
	C[1] = V['A'];
	C[2] = V['R'];
	C[3] = V['C'];
	C[4] = V['H'];
	for (int i = 0; i < 5; i++) 
		for (int j = i + 1; j < 5; j++) 
			for (int k = j + 1; k < 5; k++) {
				cnt += C[i] * C[j] * C[k];
			}

	cout << cnt << endl;
	return 0;
}