using System;
using System.Collections;
using System.Text;
class Program {
    static void Main(string[] args) {
#if LOCAL_ENVIRONMENT
        var stdin = new System.IO.StreamReader("stdin.txt");
        System.Console.SetIn(stdin);
#endif
        Inputer cin = new Inputer();
        var N = cin.GetInt();
        var S = cin.GetStringArray(N);
        long[] cnt = new long[26];
        char[,] t = new char[,] {
            {'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'}, 
        };
        for (var n = 0; n < N; n++) {
            cnt[S[n][0] - 'A']++;
        }
        long ans = 0;
        for (var n = 0; n < 10; n++) {
            long c0 = cnt[t[n, 0] - 'A'];
            long c1 = cnt[t[n, 1] - 'A'];
            long c2 = cnt[t[n, 2] - 'A'];
            ans += c0 * c1 * c2;
        }
        Console.WriteLine($"{ans}");

    } //main
    public class Inputer {
        private int cnt;
        private string[] items;
        public Inputer() {
            this.cnt = 0;
            var sb = new StringBuilder();
            var s = Console.ReadLine();
            while (s != null) {
                sb.Append(s + " ");
                s = Console.ReadLine();
            }
            this.items = sb.ToString().Split(' ');
#if LOCAL_ENVIRONMENT
            Console.Error.WriteLine("items: {0}", this.items.ToStringA());
#endif
        }
        public void SetCnt(int n) { this.cnt = n; }
        public int GetInt() {
            return int.Parse(this.items[this.cnt++]);
        }
        public long GetLong() {
            return long.Parse(this.items[this.cnt++]);
        }
        public string GetString() {
            return this.items[this.cnt++];
        }
        public int[] GetIntArray(int n) {
            if (n < 1) throw new IndexOutOfRangeException("引数は1以上であること！");
            var r = new int[n];
            for (var i = 0; i < n; i++) r[i] = this.GetInt();
#if LOCAL_ENVIRONMENT
            Console.Error.WriteLine("[{0}]", string.Join(", ", r));
#endif
            return r;
        }
        public long[] GetLongArray(int n) {
            if (n < 1) throw new IndexOutOfRangeException("引数は1以上であること！");
            var r = new long[n];
            for (var i = 0; i < n; i++) r[i] = this.GetLong();
#if LOCAL_ENVIRONMENT
            Console.Error.WriteLine("[{0}]", string.Join(", ", r));
#endif
            return r;
        }
        public string[] GetStringArray(int n) {
            if (n < 1) throw new IndexOutOfRangeException("引数は1以上であること！");
            var r = new string[n];
            for (var i = 0; i < n; i++) r[i] = this.GetString();
#if LOCAL_ENVIRONMENT
            Console.Error.WriteLine("[{0}]", string.Join(", ", r));
#endif
            return r;
        }
        public int[][] GetInt2Col(int n) {
            const int M = 2;
            if (n < 1) throw new IndexOutOfRangeException("引数は1以上であること！");
            int[][] r = new int[M][] {
                new int[n],
                new int[n],
            };
            for (var i = 0; i < n; i++) {
                r[0][i] = this.GetInt();
                r[1][i] = this.GetInt();
            }
#if LOCAL_ENVIRONMENT
            Console.Error.WriteLine("[");
            for (var i = 0; i < M; i++)
                Console.Error.WriteLine("  [{0}],", string.Join(", ", r[i]));
            Console.Error.WriteLine("]");
#endif
            return r;
        }

    }

} //class

static class Extensions {
    public static string ToStringA<T>(this T[] array, string separator = ", ", string braces = "[]") {
        string bL = braces.Length > 0 ? braces[0].ToString() : "";
        string bR = braces.Length > 1 ? braces[1].ToString() : "";
        return bL + String.Join(separator, array) + bR;
    }
}


Measured memory_bytes: 22360