Language: C++

#include <iostream>
using namespace std;

int main(void){
  int n;
  cin >> n;
  string a;
  int m,a,r,c,h = 0;
  for (int i = 0; i < n; i++)
  {
    cin >> a;
    if (a[0] = 'M') m++;
    if (a[0] = 'A') a++;
    if (a[0] = 'R') r++;
    if (a[0] = 'C') c++;
    if (a[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 << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: conflicting declaration 'int a'
    8 |   int m,a,r,c,h = 0;
      |         ^
a.cc:7:10: note: previous declaration as 'std::string a'
    7 |   string a;
      |          ^
a.cc:13:22: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
   13 |     if (a[0] = 'A') a++;
      |                     ~^~
a.cc:18:12: error: no match for 'operator*' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
   18 |   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 << endl;
      |           ~^~
      |           | |
      |           | std::string {aka std::__cxx11::basic_string<char>}
      |           int
a.cc:18:20: error: no match for 'operator*' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
   18 |   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 << endl;
      |                   ~^~
      |                   | |
      |                   | std::string {aka std::__cxx11::basic_string<char>}
      |                   int
a.cc:18:28: error: no match for 'operator*' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
   18 |   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 << endl;
      |                           ~^~
      |                           | |
      |                           | std::string {aka std::__cxx11::basic_string<char>}
      |                           int
a.cc:18:60: error: no match for 'operator*' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
   18 |   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 << endl;
      |                                                           ~^~
      |                                                           | |
      |                                                           | int
      |                                                           std::string {aka std::__cxx11::basic_string<char>}
a.cc:18:68: error: no match for 'operator*' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
   18 |   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 << endl;
      |                                                                   ~^~
      |                                                                   | |
      |                                                                   | int
      |                                                                   std::string {aka std::__cxx11::basic_string<char>}
a.cc:18:76: error: no match for 'operator*' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
   18 |   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 << endl;
      |                                                                           ~^~
      |                                                                           | |
      |                                                                           | int
      |                                                                           std::string {aka std::__cxx11::basic_string<char>}