#include <bits/stdc++.h>

#define x first
#define y second

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef long double ld;

ll cnt[256];
char all[5] = {'M','A','R','C','H'};

int main()
{
    int n;string s; cin >> n;
    while(n--) cin >>s, ++cnt[s[0]];
    ll ans = 0;
    for(int i=0;i<5;++i)
        for(int j=i+1;j<5;++j)
            for(int k=j+1;k<5;++k) ans += cnt[all[i]]*cnt[all[j]]*cnt[all[k]];
    cout << ans;
}

