#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,a) FOR(i,0,a)
const int MAX_N=1e5;
int N;

string march="MARCH";

ll cnt['Z'-'A'+1];

int main(){
	cin>>N;
	REP(i,N){
		string s;
		cin>>s;
		cnt[s[0]-'A']++;
	}
	ll ans=0;
	REP(bit,1<<5){
		int c=0;
		ll a=1;
		REP(i,5){
			if (bit&(1<<i)){
				c++;
				a*=cnt[march[i]-'A'];
			}
		}
		if (c==3){
			ans+=a;
		}
	}
	cout<<ans<<endl;
	return 0;
}