#include <iostream>
#include <cstdio>
#include <map>
using namespace std;

typedef long long LL;

int main ()
{
    int n;
    cin >> n;
    map<char,LL> mp;
    while (n--)
    {
        string s;
        cin >> s;
        mp[ s[0] ]++;
    }
    LL _=mp['M'],__=mp['A'],___=mp['R'],____=mp['C'],_____=mp['H'];
    cout << _*__*___ + _*__*____+_*__*_____ + _*___*____ + _*___*_____+_*____*_____+__*___*____+__*___*_____+__*____*_____+___*____*_____<<endl;
}
