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

int main(){
  string s="MARCH";
  long long c[5]={0};
  long long n;
  cin >> n;
  for (long long i=0;i<n;++i){
    string t;
    cin >> t;
    for (int j=0;j<5;++j){
      if (t[0]==s[j]){
        c[j]++;
      }
    }
  }
  long long 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+=c[i]*c[j]*c[k];
      }
    }
  }
  cout << ans << endl;
  return 0;
}
 
