#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
int INF = 1LL << 30;
int MOD = 1e9+7;
int main(){
    int N;
    ll cnt[5] = {};
    cin >> N;
    for(int i = 0;i < N;i++){
        string s,str = "MARCH"; 
        cin >> s;
        for(int j = 0;j < 5;j++)if(s[0] == str[j])cnt[j]++;
    }
    ll sum = 0;
    for(int i = 0;i < 5;i++)for(int j = i+1;j < 5;j++)for(int k = j+1;k < 5;k++){
        sum += cnt[i] * cnt[j] * cnt[k];
    }
    cout << sum << endl;
}