#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(void){
    int N;cin>>N;
    string s;
    ll m,a,r,h,c;m=0;a=0;r=0;h=0;c=0;
    for(int i=0;i<N;i++){
        cin>>s;
        if(s[0]=='M')m++;
        if(s[0]=='A')a++;
        if(s[0]=='R')r++;
        if(s[0]=='C')c++;
        if(s[0]=='H')h++;
    }
    cout<<m*a*r+m*a*c+m*a*h+m*r*c+m*r*h+m*c*h+a*r*c+a*r*h+a*c*h+r*c*h<<endl;
}