from collections import Counter

import itertools

ans=0

n=int(eval(input()))

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

S=Counter([i for i in list([x[0] for x in [eval(input()) for i in range(n)]]) if i in ls])



for i in itertools.combinations(list(S.values()),3):

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

print(ans)

# from collections import Counter

import itertools

ans=0

n=int(eval(input()))

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

# S=Counter([i for i in list(map(lambda x:x[0] ,[input() for i in range(n)])) if i in ls])

S = [eval(input()) for _ in range(n)]

# for i in itertools.combinations(S.values(),3):

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

# print(ans)



march={i:0 for i in ls}

for s in S:

  if s[0] in ls:

    march[s[0]]+=1

# print(march)



for i,j,k in itertools.combinations(ls,3):

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

print(ans)

from collections import Counter
import itertools

ans = 0
n = int(eval(input()))
ls = ["M", "A", "R", "C", "H"]
S = Counter(
    [i for i in list([x[0] for x in [eval(input()) for i in range(n)]]) if i in ls]
)
for i in itertools.combinations(list(S.values()), 3):
    ans += i[0] * i[1] * i[2]
print(ans)

# from collections import Counter
import itertools

ans = 0
n = int(eval(input()))
ls = ["M", "A", "R", "C", "H"]
# S=Counter([i for i in list(map(lambda x:x[0] ,[input() for i in range(n)])) if i in ls])
S = [eval(input()) for _ in range(n)]
# for i in itertools.combinations(S.values(),3):
#   ans+=i[0]*i[1]*i[2]
# print(ans)
march = {i: 0 for i in ls}
for s in S:
    if s[0] in ls:
        march[s[0]] += 1
# print(march)
for i, j, k in itertools.combinations(ls, 3):
    ans += march[i] * march[j] * march[k]
print(ans)

-from collections import Counter +# from collections import Counter -S = Counter( -    [i for i in list([x[0] for x in [eval(input()) for i in range(n)]]) if i in ls] -) -for i in itertools.combinations(list(S.values()), 3): -    ans += i[0] * i[1] * i[2] +# S=Counter([i for i in list(map(lambda x:x[0] ,[input() for i in range(n)])) if i in ls]) +S = [eval(input()) for _ in range(n)] +# for i in itertools.combinations(S.values(),3): +#   ans+=i[0]*i[1]*i[2] +# print(ans) +march = {i: 0 for i in ls} +for s in S: +    if s[0] in ls: +        march[s[0]] += 1 +# print(march) +for i, j, k in itertools.combinations(ls, 3): +    ans += march[i] * march[j] * march[k]