#include <bits/stdc++.h>
#include <cassert>
#include <cstddef>
#include <limits>
#include <type_traits>
#include <vector>

// lib/combination_generator.hpp
#ifndef COMBINATION_GENERATOR_HPP
#define COMBINATION_GENERATOR_HPP


/*
usage:
constexpr const std::size_t MAX_SOURCE_SIZE = 36;
const std::string source = "abcdefg";
tools::combination_generator<std::string, MAX_SOURCE_SIZE> subarrays(source, 4);
for (const char * const subarray : subarrays) {
  std::cout << subarray[0] << subarray[1] << subarray[2] << subarray[3] << std::endl;
}
*/

namespace tools {
  // Tは[]でランダムアクセス可能な型
  template <typename T, std::size_t MAX_SOURCE_SIZE>
  class combination_generator {
  private:
    const T& source;

  public:
    const std::size_t r;

    combination_generator(const T& source, const std::size_t r) :
      source(source),
      r(r) {
      assert(this->source.size() <= MAX_SOURCE_SIZE);
      assert(this->r <= this->source.size());
    }

    constexpr friend bool operator==(const combination_generator<T, MAX_SOURCE_SIZE>& lhs, const combination_generator<T, MAX_SOURCE_SIZE>& rhs) {
      return &lhs.source == &rhs.source && lhs.r == rhs.r;
    }

    constexpr friend bool operator!=(const combination_generator<T, MAX_SOURCE_SIZE>& lhs, const combination_generator<T, MAX_SOURCE_SIZE>& rhs) {
      return !(lhs == rhs);
    }

    class iterator {
    private:
      const combination_generator<T, MAX_SOURCE_SIZE>& parent;
      bool eoi;
      std::size_t indices[MAX_SOURCE_SIZE] = {0};
      typename T::value_type subarray[MAX_SOURCE_SIZE];

    public:
      iterator(const combination_generator<T, MAX_SOURCE_SIZE>& parent, const bool eoi) :
        parent(parent),
        eoi(eoi) {
        if (!this->eoi) {
          for (std::size_t i = 0; i < this->parent.r; ++i) {
            this->indices[i] = i;
            this->subarray[i] = this->parent.source[this->indices[i]];
          }
        }
      }

      friend bool operator==(const iterator& lhs, const iterator& rhs) {
        if (lhs.parent != rhs.parent) return false;
        if (lhs.eoi != rhs.eoi) return false;
        if (lhs.eoi) return true;
        for (std::size_t i = 0; i < lhs.parent.r; ++i) {
          if (lhs.indices[i] != rhs.indices[i]) return false;
        }
        return true;
      }

      friend bool operator!=(const iterator& lhs, const iterator& rhs) {
        return !(lhs == rhs);
      }

      const typename T::value_type* operator*() const {
        return this->subarray;
      }

      iterator& operator++() {
        for (std::size_t i = this->parent.r - 1; i != std::numeric_limits<std::size_t>::max(); --i) {
          ++this->indices[i];
          if (this->indices[i] <= this->parent.source.size() - this->parent.r + i) {
            this->subarray[i] = this->parent.source[this->indices[i]];
            for (std::size_t j = i + 1; j < this->parent.r; ++j) {
              this->indices[j] = this->indices[j - 1] + 1;
              this->subarray[j] = this->parent.source[this->indices[j]];
            }
            return *this;
          }
        }
        this->eoi = true;
        return *this;
      }
    };

    iterator begin() const {
      return iterator(*this, false);
    }

    iterator end() const {
      return iterator(*this, true);
    }
  };
}

#endif

// main.cpp

int main() {
  std::int_fast64_t N;
  std::cin >> N;
  std::array<std::int_fast64_t, 5> march = {0, 0, 0, 0, 0};
  for (std::int_fast64_t i = 0; i < N; ++i) {
    std::string S_i;
    std::cin >> S_i;
    switch (S_i[0]) {
    case 'M':
      ++march[0];
      break;
    case 'A':
      ++march[1];
      break;
    case 'R':
      ++march[2];
      break;
    case 'C':
      ++march[3];
      break;
    case 'H':
      ++march[4];
      break;
    }
  }

  tools::combination_generator<std::array<std::int_fast64_t, 5>, 5> subarrays(march, 3);
  std::cout << std::accumulate(subarrays.begin(), subarrays.end(), static_cast<std::int_fast64_t>(0), [](const std::int_fast64_t sum, const std::int_fast64_t * const subarray) {
    return sum + subarray[0] * subarray[1] * subarray[2];
  }) << std::endl;
  return 0;
}

Measured memory_bytes: 256