var input = require('fs').readFileSync('/dev/stdin', 'utf8');

var inputList = input.split('\n');

var n = Number(inputList[0]);

var capitalWordsList = inputList[1].split(' ').map(i => i.split('')[0]);

var mNum = capitalWordsList.filter(s => s === 'M').length;
var aNum = capitalWordsList.filter(s => s === 'A').length;
var rNum = capitalWordsList.filter(s => s === 'R').length;
var cNum = capitalWordsList.filter(s => s === 'C').length;
var hNum = capitalWordsList.filter(s => s === 'H').length;

var lengthList = [mNum, aNum, rNum, cNum, hNum];

var threeList = [];

var chooseThreeFromList = (list) => {
  for (var i=0;i<5;i++) {
    var list1 = [];
    list1.push(list[i]);
    for (var j=i+1;j<5;j++) {
      var list2 = list1.slice();
      list2.push(list[j]);
      for (var k=j+1;k<5;k++) {
        var list3 = list2.slice();
        list3.push(list[k]);
        threeList.push(list3);
      }
    }
  }
};

chooseThreeFromList(lengthList);

const result = threeList.map((i) => i.reduce((a,b)=>a*b)).reduce((a,b)=>a+b);

console.log(result);
