#include <bits/stdc++.h>
using namespace std;
int main(){
    unsigned long long N,m=0,a=0,r=0,c=0,h=0;
    cin >> N;
    vector<string> S(N);
    for(int i = 0;i < N;i ++){
        cin >> S[i];
        if(S[i][0]=='M') m++;
        if(S[i][0]=='A') a++;
        if(S[i][0]=='R') r++;
        if(S[i][0]=='C') c++;
        if(S[i][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;
    
    return 0;
}