n = int(eval(input()))

ss = "MARCH"

c = [0 for i in range(5)]

for i in range(n):

	s = eval(input())

	for j in range(5):

		if s[0] == ss[j]:

			c[j] += 1

ans = 0

for i in range(5):

	for j in range(i+1,5):

		for k in range(j+1,5):

			ans += c[i]*c[j]*c[k]

print (ans)
import math

n = int(eval(input()))

a = ["M","A","R","C","H"]

dic = {}

def combination(n,r):

	return math.factorial(n) // (math.factorial(n-r) * math.factorial(r))

for i in range(n):

	x = eval(input())

	if x[0] in a:

		if x[0] in dic:

			dic[x[0]] += 1

		else:

			dic[x[0]] = 1

b = []

for i in list(dic.values()):

	b.append(i)



ans = 0

for i in range(len(dic)):

	for j in range(i+1,len(dic)):

		for k in range(j+1,len(dic)):

			ans += b[i]*b[j]*b[k]

print (ans)
n = int(eval(input()))
ss = "MARCH"
c = [0 for i in range(5)]
for i in range(n):
    s = eval(input())
    for j in range(5):
        if s[0] == ss[j]:
            c[j] += 1
ans = 0
for i in range(5):
    for j in range(i + 1, 5):
        for k in range(j + 1, 5):
            ans += c[i] * c[j] * c[k]
print(ans)

import math

n = int(eval(input()))
a = ["M", "A", "R", "C", "H"]
dic = {}


def combination(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


for i in range(n):
    x = eval(input())
    if x[0] in a:
        if x[0] in dic:
            dic[x[0]] += 1
        else:
            dic[x[0]] = 1
b = []
for i in list(dic.values()):
    b.append(i)
ans = 0
for i in range(len(dic)):
    for j in range(i + 1, len(dic)):
        for k in range(j + 1, len(dic)):
            ans += b[i] * b[j] * b[k]
print(ans)

+import math + -ss = "MARCH" -c = [0 for i in range(5)] +a = ["M", "A", "R", "C", "H"] +dic = {} + + +def combination(n, r): +    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r)) + + -    s = eval(input()) -    for j in range(5): -        if s[0] == ss[j]: -            c[j] += 1 +    x = eval(input()) +    if x[0] in a: +        if x[0] in dic: +            dic[x[0]] += 1 +        else: +            dic[x[0]] = 1 +b = [] +for i in list(dic.values()): +    b.append(i) -for i in range(5): -    for j in range(i + 1, 5): -        for k in range(j + 1, 5): -            ans += c[i] * c[j] * c[k] +for i in range(len(dic)): +    for j in range(i + 1, len(dic)): +        for k in range(j + 1, len(dic)): +            ans += b[i] * b[j] * b[k]