var input=`
5
MASHIKE
RUMOI
OBIRA
HABORO
HOROKANAI
`;
var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var arr=input.trim().split("\n").map(v=> v.trim()).reverse();
var n=arr.pop()-0;
var obj={M:0,A:0,R:0,C:0,H:0}
arr.forEach(v=>{
   if(obj.hasOwnProperty(v[0]))obj[v[0]]++;
});
var ary=Object.values(obj);
var sum=0;
for(var i=0;i<5;i++){
    for(var j=i+1;j<5;j++){
       for(var k=j+1;k<5;k++){
          sum+=ary[i]*ary[j]*ary[k];
       }
    }
 }
 console.log(sum);