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

string T{"MARCH"};
vector<int>
A{0,0,0,0,0,0,1,1,1,2},
B{1,1,1,2,2,3,2,2,3,3},
C{2,3,4,3,4,4,3,4,4,4};

int main(){
	int N; cin>>N;

	map<char,ll> S; for(auto c:T) S[c] = 0;

	while(N--){
		string s; cin>>s;
		for(auto c:T) if(s[0]==c) S[c]++;
	}

	ll ans = 0;
	for(int i=0; i<10; ++i)
		ans += S[T[A[i]]] * S[T[B[i]]] * S[T[C[i]]];
	cout<< ans <<endl;
}