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

int main()
{
    map <char, long long int> mp;
    map <char, long long int> :: iterator it;
    int n;
    string str;
    cin>>n;
    for(int i=0; i<n; i++){
        cin>>str;
        if(str[0]=='M' || str[0]=='A' || str[0]=='R' || str[0]=='C' || str[0]=='H')
        {
            mp[str[0]]++;
        }
    }

    if(mp.size()<3)
        cout<<"0"<<endl;
    else{
        int a = mp['M'] * mp['A'] * mp['R'] +
                mp['M'] * mp['A'] * mp['C'] +
                mp['M'] * mp['A'] * mp['H'] +
                mp['M'] * mp['R'] * mp['C'] +
                mp['M'] * mp['R'] * mp['H'] +
                mp['M'] * mp['C'] * mp['H'] +
                mp['A'] * mp['R'] * mp['C'] +
                mp['A'] * mp['R'] * mp['H'] +
                mp['A'] * mp['C'] * mp['H'] +
                mp['R'] * mp['C'] * mp['H'];
        cout<<a<<endl;
    }
}
