#include <bits/stdc++.h>
using namespace std;

int mark[30], n;
string s;
char ch[5] = {'M', 'A', 'R', 'C', 'H'};
long long ans;

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);
	
	cin >> n;
	for (int i = 0; i < n; i++){
		cin >> s;
		mark[s[0] - 'A']++;
	}	
	for (int i = 0; i < 5; i++)
		for (int j = i + 1; j < 5; j++)
			for (int k = j + 1; k < 5; k++)
				ans += (1LL * mark[ch[k] - 'A'] * mark[ch[j] - 'A'] * mark[ch[i] - 'A']);
	cout << ans;
}
