// C - March
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main(){
	string T{"MARCH"};

	int N; cin>>N;

	vector<int> C(T.size());
	while(N--){
		string s; cin>>s;
		for(int t=0; t<T.size(); ++t)
			if(s[0]==T[t]) C[t]++;
	}

	ll ans = 0;
	for(int i=0; i<C.size(); ++i)
		for(int j=i+1; j<C.size(); ++j)
			for(int k=j+1; k<C.size(); ++k)
				ans += (ll)C[i] * C[j] * C[k];
	cout<< ans <<endl;
}