#include <iostream>
using namespace std;
#include <algorithm>

#define REP(i,a,b) for(int64_t i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
char c[5] = {'M', 'A', 'R', 'C', 'H'};
int64_t a[5];

int main(){
rep(i,5) a[i] = 0;

int64_t n;
cin >> n;

rep(i,n){
	char tmp[15];
	cin >> tmp;
	rep(j,5){
		if(tmp[0] == c[j]){ a[j]++;}
	}
}

int64_t out = 0;
rep(i,5){ REP(j,i+1,5){ REP(k,j+1,5){
	out += a[i] * a[j] * a[k];
}}}

cout << out <<endl;

return 0;
}
