

N = int(eval(input()))

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



ch = "MARCH"

xs = [0] * 5



for s in S:

    if s[0] in ch:

        i = ch.index(s[0])

        xs[i] += 1



from itertools import combinations



def calc(xs):

    r = 0

    for ys in combinations([0, 1, 2, 3, 4], 3):

        r += xs[ys[0]] * xs[ys[1]] * xs[ys[2]]

    return r



print((calc(xs)))



from collections import defaultdict

from itertools import combinations



N = int(eval(input()))

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



CHARS = "MARCH"



xs = defaultdict(int)



for s in S:

    xs[s[0]] += 1



def calc(xs):

    return sum(xs[a] * xs[b] * xs[c] for a, b, c in combinations(CHARS, 3))



print((calc(xs)))

N = int(eval(input()))
S = [eval(input()) for i in range(N)]
ch = "MARCH"
xs = [0] * 5
for s in S:
    if s[0] in ch:
        i = ch.index(s[0])
        xs[i] += 1
from itertools import combinations


def calc(xs):
    r = 0
    for ys in combinations([0, 1, 2, 3, 4], 3):
        r += xs[ys[0]] * xs[ys[1]] * xs[ys[2]]
    return r


print((calc(xs)))

from collections import defaultdict
from itertools import combinations

N = int(eval(input()))
S = [eval(input()) for i in range(N)]
CHARS = "MARCH"
xs = defaultdict(int)
for s in S:
    xs[s[0]] += 1


def calc(xs):
    return sum(xs[a] * xs[b] * xs[c] for a, b, c in combinations(CHARS, 3))


print((calc(xs)))

+from collections import defaultdict +from itertools import combinations + -ch = "MARCH" -xs = [0] * 5 +CHARS = "MARCH" +xs = defaultdict(int) -    if s[0] in ch: -        i = ch.index(s[0]) -        xs[i] += 1 -from itertools import combinations +    xs[s[0]] += 1 -    r = 0 -    for ys in combinations([0, 1, 2, 3, 4], 3): -        r += xs[ys[0]] * xs[ys[1]] * xs[ys[2]] -    return r +    return sum(xs[a] * xs[b] * xs[c] for a, b, c in combinations(CHARS, 3))