// Boy_of_KutBilim
#include <iostream>
using namespace std;

#define endl '\n'
#define ll long long
#define ull unsigned ll

typedef string BigInt;

int dp[5];

int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	
	
	ll n, m, a, r, c, h, cnt = 0;
	cin >> n;
	m = a = r = c = h = 0;
	string str;
	while(n --){
		cin >> str;
		if(str[0] == 'M') m++;
		if(str[0] == 'A') a++;
		if(str[0] == 'R') r++;
		if(str[0] == 'C') c++;
		if(str[0] == 'H') h++;
	}
	
	ll res[1 + 10];
	res[1] = m*a*r;
	res[2] = m*a*c;
	res[3] = m*a*h;
	res[4] = m*r*c;
	res[5] = m*r*h;
	res[6] = m*c*h;
	res[7] = a*r*c;
	res[8] = a*r*h;
	res[9] = a*c*h;
	res[10] = r*c*h;
	ll sum = 0;
	for(int i = 1; i <= 10; i++) sum += res[i];
	cout << sum;
	
	return 0;
}