#include <string>
#include <vector>
#include <iostream>
using namespace std;
int main() {
	int N;
	cin >> N;
	vector<int> c(5);
	for (int i = 0; i < N; ++i) {
		string s;
		cin >> s;
		if (string("MARCH").find(s[0]) != string::npos) {
			++c[string("MARCH").find(s[0])];
		}
	}
	long long ans = 0;
	for (int i = 0; i < 5; ++i) {
		for (int j = 0; j < i; ++j) {
			for (int k = 0; k < j; ++k) {
				ans += 1LL * c[i] * c[j] * c[k];
			}
		}
	}
	cout << ans << endl;
	return 0;
}