from collections import Counter

import itertools



N = int(eval(input()))

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



ctr = Counter()

for s in src:

    ctr.update(s[0])



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 collections import Counter

N = int(eval(input()))

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

ctr = Counter([s[0] for s in src])



ans = 0

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

    ans += ctr[ptn[0]]*ctr[ptn[1]]*ctr[ptn[2]]

print(ans)

from collections import Counter
import itertools

N = int(eval(input()))
src = [eval(input()) for i in range(N)]
ctr = Counter()
for s in src:
    ctr.update(s[0])
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 collections import Counter

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

+import itertools -import itertools -ctr = Counter() -for s in src: -    ctr.update(s[0]) +ctr = Counter([s[0] for s in src]) -    a, b, c = ptn -    ans += ctr[a] * ctr[b] * ctr[c] +    ans += ctr[ptn[0]] * ctr[ptn[1]] * ctr[ptn[2]]