#include <bits/stdc++.h>
#define int long long
using namespace std;

signed main(){
    int N; cin>>N;
    map<char,int> dic;
    for(int i=0;i<N;i++){
        string S; cin>>S;
        dic[S[0]]++;
    }
    int ans=0;
    ans+=dic['M']*dic['A']*(dic['R']+dic['C']+dic['H']);
    ans+=dic['M']*dic['R']*(dic['C']+dic['H']);
    ans+=dic['M']*dic['C']*dic['H'];
    ans+=dic['A']*dic['R']*(dic['C']+dic['H']);
    ans+=dic['C']*dic['H']*(dic['A']+dic['R']);
    cout<<ans<<endl;
}