#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define int long long
int q[2000];
main(){
    int n,i,c,k,l=0;
    cin>>n;
    string s;
    for (i=0;i<n;++i){
        cin>>s;
        q[s[0]]++;
    }
    int r=1;
    c=q['M']+q['A']+q['R']+q['C']+q['H'];
    if (q['M']>1){
        l+=q['A']+q['R']+q['C']+q['H'];
    }
    if (q['A']>1){
        l+=q['M']+q['R']+q['C']+q['H'];
    }
    if (q['R']>1){
        l+=q['M']+q['A']+q['C']+q['H'];
    }
    if (q['C']>1){
        l+=q['M']+q['A']+q['R']+q['H'];
    }
    if (q['H']>1){
        l+=q['M']+q['A']+q['R']+q['C'];
    }
    if (c-3>3){
        k=1;
        for (i=c-2;i<=c;++i){
            k*=i;
        }
        r=6;
    }
    else {

        k=1;
        for (i=4;i<=c;++i){
            k*=i;
        }
        for (i=2;i<=c-3;++i){
            r*=i;
        }
    }
    cout <<k/r-l;
}
