from itertools import combinations

from collections import Counter

N = int(eval(input()))

S = Counter()

for _ in range(N):

  S[input()[0]] += 1

print((sum([S[p0]*S[p1]*S[p2] for p0,p1,p2 in combinations('MARCH', 3)])))

quit()

from itertools import combinations

N = int(eval(input()))

d = [0]*128

for _ in range(N): d[ord(input()[0])] += 1

print((sum([d[ord(p0)]*d[ord(p1)]*d[ord(p2)] for p0,p1,p2 in combinations('MARCH', 3)])))

from itertools import combinations
from collections import Counter

N = int(eval(input()))
S = Counter()
for _ in range(N):
    S[input()[0]] += 1
print((sum([S[p0] * S[p1] * S[p2] for p0, p1, p2 in combinations("MARCH", 3)])))
quit()

from itertools import combinations

N = int(eval(input()))
d = [0] * 128
for _ in range(N):
    d[ord(input()[0])] += 1
print(
    (
        sum(
            [
                d[ord(p0)] * d[ord(p1)] * d[ord(p2)]
                for p0, p1, p2 in combinations("MARCH", 3)
            ]
        )
    )
)

-from collections import Counter -S = Counter() +d = [0] * 128 -    S[input()[0]] += 1 -print((sum([S[p0] * S[p1] * S[p2] for p0, p1, p2 in combinations("MARCH", 3)]))) -quit() +    d[ord(input()[0])] += 1 +print( +    ( +        sum( +            [ +                d[ord(p0)] * d[ord(p1)] * d[ord(p2)] +                for p0, p1, p2 in combinations("MARCH", 3) +            ] +        ) +    ) +)