import itertools

'''

　 ∧_,,∧    究極奥義「WAがACになーれ！！」

　（`・ω・)つ━☆・*。

　⊂　　 ノ 　　　・゜+.

　 し’´Ｊ　　*・ 

'''

n=int(eval(input()))



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

cnt=[0]*5

for i in range(n):

    s=eval(input())

    for i in range(5):

        if s[0]==a[i]:

            cnt[i]+=1

ans=0

for i in itertools.combinations(list(range(5)),3):

    ans+=cnt[i[0]]*cnt[i[1]]*cnt[i[2]]

print(ans)
import sys

input = sys.stdin.readline

n=int(eval(input()))



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

cnt=[0]*5

for i in range(n):

    s=eval(input())

    for i in range(5):

        if s[0]==a[i]:

            cnt[i]+=1

ans=0

for i in range(3):

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

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

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

print(ans)

import itertools

"""
　 ∧_,,∧    究極奥義「WAがACになーれ！！」
　（`・ω・)つ━☆・*。
　⊂　　 ノ 　　　・゜+.
　 し’´Ｊ　　*・ 
"""
n = int(eval(input()))
a = ["M", "A", "R", "C", "H"]
cnt = [0] * 5
for i in range(n):
    s = eval(input())
    for i in range(5):
        if s[0] == a[i]:
            cnt[i] += 1
ans = 0
for i in itertools.combinations(list(range(5)), 3):
    ans += cnt[i[0]] * cnt[i[1]] * cnt[i[2]]
print(ans)

import sys

input = sys.stdin.readline
n = int(eval(input()))
a = ["M", "A", "R", "C", "H"]
cnt = [0] * 5
for i in range(n):
    s = eval(input())
    for i in range(5):
        if s[0] == a[i]:
            cnt[i] += 1
ans = 0
for i in range(3):
    for j in range(i + 1, 4):
        for k in range(j + 1, 5):
            ans += cnt[i] * cnt[j] * cnt[k]
print(ans)

-import itertools +import sys -""" -　 ∧_,,∧    究極奥義「WAがACになーれ！！」 -　（`・ω・)つ━☆・*。 -　⊂　　 ノ 　　　・゜+. -　 し’´Ｊ　　*・ -""" +input = sys.stdin.readline -for i in itertools.combinations(list(range(5)), 3): -    ans += cnt[i[0]] * cnt[i[1]] * cnt[i[2]] +for i in range(3): +    for j in range(i + 1, 4): +        for k in range(j + 1, 5): +            ans += cnt[i] * cnt[j] * cnt[k]