#include <iostream>
#include <vector>

typedef unsigned long long ull;
using namespace std;

int a[35][35];

int main() {
	int n;
	cin >> n;
	
	string s;
	ull m = 0, a = 0, r = 0, c = 0, h = 0;
	
	for(int i=0; i < n; i++) {
		cin >> s;
		
		if(s[0] == 'M')
			m++;
		if(s[0] == 'A')
			a++;
		if(s[0] == 'R')
			r++;
		if(s[0] == 'C')
			c++;
		if(s[0] == 'H')
			h++;
	}
	
	cout << 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;
}
//cnt += a[i-1][j-1] + a[i-1][j] + a[i-1][j+1] + a[i][j+1] + a[i+1][j+1] + a[i+1][j] + a[i+1][j-1] + a[i][j-1];