from collections import Counter

from itertools import combinations



N = int(eval(input()))

ctr = Counter()

for i in range(N):

    s = eval(input())

    ctr[s[0]] += 1



ans = 0

for ptn in combinations('MARCH', 3):

    tmp = 1

    for c in ptn:

        tmp *= ctr[c]

    ans += tmp

print(ans)
import itertools

from collections import Counter

N = int(eval(input()))

src = [eval(input()) for i in range(N)]

ctr = Counter()

for s in src:

    ctr[s[0]] += 1



ans = 0

for ptn in itertools.combinations('MARCH',3):

    a,b,c = ptn

    ans += ctr[a]*ctr[b]*ctr[c]

print(ans)
from collections import Counter
from itertools import combinations

N = int(eval(input()))
ctr = Counter()
for i in range(N):
    s = eval(input())
    ctr[s[0]] += 1
ans = 0
for ptn in combinations("MARCH", 3):
    tmp = 1
    for c in ptn:
        tmp *= ctr[c]
    ans += tmp
print(ans)

import itertools
from collections import Counter

N = int(eval(input()))
src = [eval(input()) for i in range(N)]
ctr = Counter()
for s in src:
    ctr[s[0]] += 1
ans = 0
for ptn in itertools.combinations("MARCH", 3):
    a, b, c = ptn
    ans += ctr[a] * ctr[b] * ctr[c]
print(ans)

+import itertools -from itertools import combinations +src = [eval(input()) for i in range(N)] -for i in range(N): -    s = eval(input()) +for s in src: -for ptn in combinations("MARCH", 3): -    tmp = 1 -    for c in ptn: -        tmp *= ctr[c] -    ans += tmp +for ptn in itertools.combinations("MARCH", 3): +    a, b, c = ptn +    ans += ctr[a] * ctr[b] * ctr[c]