#include <iostream>
int main(){
  char name[11];
  int n;
  long int m=0,a=0,r=0,c=0,h=0;
  scanf("%d",&n);
  for(int i=0;i<n;i++){
    scanf("%s",name);
    if(name[0]=='M'){
      m++;
    }else if(name[0]=='A'){
      a++;
    }else if(name[0]=='R'){
      r++;
    }else if(name[0]=='C'){
      c++;
    }else if(name[0]=='H'){
      h++;
    }
  }
  printf("%ld\n",m*a*r+m*a*c+m*a*h+m*r*c+m*r*h+m*c*h+a*r*c+a*r*h+a*c*h+r*c*h);
  return 0;
}