#include <bits/stdc++.h>
using namespace std;
int dy[] = {0, 0, 1, -1, 0};
int dx[] = {1, -1, 0, 0, 0};
map<char, int> S;
int main() {
  int n;
  cin >> n;
  int a[5];
  memset(a, 0, sizeof(a));
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    if (s[0] == 'M')
      a[0]++;
    else if (s[0] == 'A')
      a[1]++;
    else if (s[0] == 'R')
      a[2]++;
    else if (s[0] == 'C')
      a[3]++;
    else if (s[0] == 'H')
      a[4]++;
  }
  long long ans = 0;
  for (int i = 0; i < 3; i++) {
    for (int j = i + 1; j < 4; j++) {
      for (int k = j + 1; k < 5; k++) {
        ans += a[i] * a[j] * a[k];
      }
    }
  }
  cout << ans << endl;
}
