#include <bits/stdc++.h>
#define REP(i, a, n) for(ll i = ((ll) a); i < ((ll) n); i++)
using namespace std;
typedef long long ll;

int main(void) {
  ll N;
  cin >> N;
  string t = "MARCH";
  vector<ll> cnt(5, 0);
  REP(i, 0, N) {
    string S;
    cin >> S;
    REP(j, 0, 5) if(S[0] == t[j]) cnt[j]++;
  }

  ll ans = 0;
  REP(i, 0, 5) REP(j, i + 1, 5) REP(k, j + 1, 5) {
    ans += cnt[i] * cnt[j] * cnt[k];
  }
  cout << ans << endl;
}
