#include <iostream>
#include <stdio.h>
#include <string>
#include <vector>
using namespace std;
int main(){
unsigned long long N = 0;
unsigned long long M=0, A=0, R=0, C=0, H=0;
cin >> N;
string s;
for(int i=0; i<N; i++){
cin >> s;
if(s[0]=='M'){
M+=1;
}else if(s[0]=='A'){
A+=1;
}else if(s[0]=='R'){
R+=1;
}else if(s[0]=='C'){
C+=1;
}else if(s[0]=='H'){
H+=1;
}
}
unsigned long long sum = 0;
sum += M * A * R;
sum += M * A * C;
sum += M * A * H;
sum += M * R * C;
sum += M * R * H;
sum += M * C * H;
sum += A * R * C;
sum += A * R * H;
sum += A * C * H;
sum += R * C * H;
printf("%llu\n", sum);
return 0;
}