#include "bits/stdc++.h"

// Begin {{{
using namespace std;

#define all(x) x.begin(), x.end()
#define rep(i, n) for (i64 i = 0; i < (n); ++i)
#define reps(i, b, e) for (i64 i = (b); i <= (e); ++i)
#define repr(i, b, e) for (i64 i = (b); i >= (e); --i)
#define var(Type, ...) Type __VA_ARGS__; input(__VA_ARGS__)

#ifdef DEBUG
#define dump(...) dump_(#__VA_ARGS__, __VA_ARGS__);
#else
#define dump(...)
#endif

using i64 = int_fast64_t;
using pii = pair<i64, i64>;

template <class A, class B>
inline bool chmax(A &a, const B &b) { return b > a && (a = b, true); }

template <class A, class B>
inline bool chmin(A &a, const B &b) { return b < a && (a = b, true); }

constexpr int INF = 0x3f3f3f3f;
constexpr i64 LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr int MOD = int(1e9) + 7;

// input
void input() {}
template <class Head, class... Tail>
void input(Head&& head, Tail&&... tail) {
  cin >> head;
  input(forward<Tail>(tail)...);
}

// outs
void outs() {}
template <class Head, class... Tail>
void outs(Head&& head, Tail&&... tail) {
  cout << head << " \n"[sizeof...(tail)==0];
  outs(forward<Tail>(tail)...);
}

template <class T>
void outs(vector<T> &vec) { for (auto &e : vec) cout << e << " \n"[&e==&vec.back()]; }

template <class T>
void outs(vector<vector<T>> &df) { for (auto &vec : df) OUTS(vec); }

// outl
void outl() {}
template <class Head, class... Tail>
void outl(Head&& head, Tail&&... tail) {
  cout << head << "\n";
  outl(forward<Tail>(tail)...);
}

template <class T>
void outl(vector<T> &vec) { for (auto &e : vec) cout << e << "\n"; }

// outn
void outn() {}
template <class Head, class... Tail>
void outn(Head&& head, Tail&&... tail) {
  cout << head;
  outn(forward<Tail>(tail)...);
}

template <class T>
void outn(vector<T> &vec) { for (auto &e : vec) cout << e; }

// dump
template <class T>
void dump_(const char *s, T&& x) {
  clog << '{';
  while(*s != '\0') clog << *(s++);
  clog << ": " << x << '}' << "\n";
}

template <class Head, class... Tail>
void dump_(const char *s, Head&& head, Tail&&... tail) {
  clog << '{';
  while(*s != ',') clog << *(s++);
  clog << ": " << head << "}, ";
  for (++s; !isgraph(*s); ++s);
  dump_(s, forward<Tail>(tail)...);
}
// }}} End

// Mint {{{
template <i64 MOD>
class ModInt {
  i64 value;
public:
  inline ModInt(const ModInt& other) noexcept : value(other.value) {}
  inline ModInt(i64 value = 0) noexcept :
    value((value >= MOD) ? value % MOD : (value < 0) ? (value + MOD) % MOD : value) {}

  inline ModInt inv() const noexcept { return power(value, MOD - 2); }

  inline ModInt& operator+=(const ModInt& other) noexcept {
    value = (value + other.value) % MOD; return *this;
  }
  inline ModInt& operator-=(const ModInt& other) noexcept {
    value = (MOD + value - other.value) % MOD; return *this;
  }
  inline ModInt& operator*=(const ModInt& other) noexcept {
    value = (value * other.value) % MOD; return *this;
  }
  inline ModInt& operator/=(const ModInt& other) noexcept {
    value = (value * other.inv().value) % MOD; return *this;
  }

  inline ModInt operator+(const ModInt& other) noexcept { return ModInt(*this) += other; }
  inline ModInt operator-(const ModInt& other) noexcept { return ModInt(*this) -= other; }
  inline ModInt operator*(const ModInt& other) noexcept { return ModInt(*this) *= other; }
  inline ModInt operator/(const ModInt& other) noexcept { return ModInt(*this) /= other; }

  inline bool operator==(const ModInt& other) noexcept { return value == *other; }
  inline bool operator!=(const ModInt& other) noexcept { return value != *other; }

  template <class int_>
    explicit inline operator int_() const noexcept { return static_cast<int_>(value); }

  friend ostream& operator<<(ostream &os, ModInt other) noexcept {
    os << other.value; return os;
  }

  friend istream& operator>>(istream &is, ModInt& other) noexcept {
    is >> other.value; return is;
  }

  static constexpr inline ModInt power(i64 n, i64 p) noexcept {
    i64 ret = 1;
    for (; p > 0; p >>= 1) {
      if (p & 1) ret = (ret * n) % MOD;
      n = (n * n) % MOD;
    }
    return ret;
  }
};

using Mint = ModInt<int(1e9) + 7>;
// }}}

// Factorial {{{
#ifdef DEBUG
#define constexpr
#endif

template <size_t N, int M>
struct Factorial {
  uint_fast64_t fact_[N+1];

  constexpr inline Factorial() : fact_{1} {
    for (i64 i = 1; i <= N; ++i) fact_[i] = (fact_[i-1] * i) % M;
  }

  constexpr inline Mint operator[] (size_t pos) const { return fact_[pos]; }
};

template <size_t N, int M>
struct InvFact {
  uint_fast64_t inv_[N+1];
  uint_fast64_t finv_[N+1];

  constexpr inline InvFact() : inv_{0, 1}, finv_{1, 1} {
    for (i64 i = 2; i <= N; ++i) {
      inv_[i] = M - inv_[M%i] * (M / i) % M;
      finv_[i] = finv_[i-1] * inv_[i] % M;
    }
  }

  constexpr inline Mint operator[] (size_t pos) const { return finv_[pos]; }
};

#ifdef constexpr
#undef constexpr
#endif

Factorial<510000, MOD> fact;
InvFact<510000, MOD> finv;

Mint nCr(int n, int r) {
  if (n < r) return 0;
  if (n < 0 || r < 0) return 0;
  return fact[n] * (finv[r] * finv[n-r]);
}

Mint nPr(int n, int r) {
  if (n < r) return 0;
  if (n < 0 || r < 0) return 0;
  return fact[n] * finv[r];
}
// }}}

signed main()
{
  ios::sync_with_stdio(false);
  cin.tie(nullptr);

  var(int, N);

  map<char, i64> cnt;
  rep(i, N) {
    var(string, s);
    ++cnt[s.front()];
  }

  i64 res = 0;
  string march = "MARCH";

  for (int i = 0; i < 5; ++i) {
    for (int j = i + 1; j < 5; ++j) {
      for (int k = j + 1; k < 5; ++k) {
        i64 c1 = cnt[march[i]], c2 = cnt[march[j]], c3 = cnt[march[k]];
        if (c1 && c2 && c3) {
          res += c1 * c2 * c3;
        }
      }
    }
  }

  outl(res);

  return 0;
}


Measured memory_bytes: 256