n = int(eval(input()))

lst = [0] * 5

march = ['M', 'A', 'R', 'C', 'H']

for i in range(n):

  nf = input()[0]

  if nf in march:

    lst[march.index(nf)] += 1

ret = 0

for a in range(0, 3):

  for b in range(a + 1, 4):

    for c in range(b + 1, 5):

      ret += lst[a] * lst[b] * lst[c]

print(ret)
import sys

from itertools import combinations as comb

n, *S = open(0).read().split()

s = [i[0] for i in S]

c = [s.count(i) for i in 'MARCH']

ret = sum(x * y * z for x, y, z in comb(c, 3))

print(ret)
n = int(eval(input()))
lst = [0] * 5
march = ["M", "A", "R", "C", "H"]
for i in range(n):
    nf = input()[0]
    if nf in march:
        lst[march.index(nf)] += 1
ret = 0
for a in range(0, 3):
    for b in range(a + 1, 4):
        for c in range(b + 1, 5):
            ret += lst[a] * lst[b] * lst[c]
print(ret)

import sys
from itertools import combinations as comb

n, *S = open(0).read().split()
s = [i[0] for i in S]
c = [s.count(i) for i in "MARCH"]
ret = sum(x * y * z for x, y, z in comb(c, 3))
print(ret)

-n = int(eval(input())) -lst = [0] * 5 -march = ["M", "A", "R", "C", "H"] -for i in range(n): -    nf = input()[0] -    if nf in march: -        lst[march.index(nf)] += 1 -ret = 0 -for a in range(0, 3): -    for b in range(a + 1, 4): -        for c in range(b + 1, 5): -            ret += lst[a] * lst[b] * lst[c] +import sys +from itertools import combinations as comb + +n, *S = open(0).read().split() +s = [i[0] for i in S] +c = [s.count(i) for i in "MARCH"] +ret = sum(x * y * z for x, y, z in comb(c, 3))