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]++;
  }
  char[int] p;
  p[0]='M'; p[1]='A'; p[2]='R'; p[3]='C'; p[4]='H';

  long fun(int i, char[] h){
    if(h.length==3){
      long ret=1;
      foreach(c; h) ret*=cnt[c];
      return ret;
    }else if(i>=5){
      return 0L;
    }else{
      long ret=0;
      foreach(j; i..5)
        ret+=fun(j+1, h~p[j]);
      return ret;
    }
  }

  writeln(fun(0, []));
}

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));
  }
}