void main(){
  import std.stdio, std.string, std.conv, std.algorithm;

  int n; rd(n);
  auto s=new char[][](n);
  foreach(i; 0..n) s[i]=readln.chomp.to!(char[]);

  long[char] cnt;
  cnt['M']=cnt['A']=cnt['R']=cnt['C']=cnt['H']=0L;
  foreach(i; 0..n){
    auto c=s[i][0];
    if(c in cnt) cnt[c]++;
  }

  long tot=0;
  tot+=cnt['M']*cnt['A']*cnt['R'];
  tot+=cnt['M']*cnt['A']*cnt['C'];
  tot+=cnt['M']*cnt['A']*cnt['H'];
  tot+=cnt['M']*cnt['R']*cnt['C'];
  tot+=cnt['M']*cnt['R']*cnt['H'];
  tot+=cnt['M']*cnt['C']*cnt['H'];
  tot+=cnt['A']*cnt['R']*cnt['C'];
  tot+=cnt['A']*cnt['R']*cnt['H'];
  tot+=cnt['A']*cnt['C']*cnt['H'];
  tot+=cnt['R']*cnt['C']*cnt['H'];

  writeln(tot);
}

void rd(T...)(ref T x){
  import std.stdio, std.string, std.conv;
  auto l=readln.split;
  assert(l.length==x.length);
  foreach(i, ref e; x){
    e=l[i].to!(typeof(e));
  }
}