input = open(0).read



N, *Sn = list(map(str, input().split()))

N = int(N)





def main():

    M = {j for j in Sn if j[0] in "M"}

    A = {j for j in Sn if j[0] in "A"}

    R = {j for j in Sn if j[0] in "R"}

    C = {j for j in Sn if j[0] in "C"}

    H = {j for j in Sn if j[0] in "H"}



    m = len(M)

    a = len(A)

    r = len(R)

    c = len(C)

    h = len(H)



    print((

        m * a * r

        + m * a * c

        + m * a * h

        + m * r * c

        + m * r * h

        + m * c * h

        + a * r * c

        + a * r * h

        + a * c * h

        + r * c * h))



    return





main()

from itertools import combinations



input = open(0).read



Sn = [i[0] for i in input().split() if i[0] in "MARCH"]





def main():



    print((

        sum(x * y * z for x, y, z

            in combinations([Sn.count(s) for s in "MARCH"], 3))))



    return





main()

input = open(0).read
N, *Sn = list(map(str, input().split()))
N = int(N)


def main():
    M = {j for j in Sn if j[0] in "M"}
    A = {j for j in Sn if j[0] in "A"}
    R = {j for j in Sn if j[0] in "R"}
    C = {j for j in Sn if j[0] in "C"}
    H = {j for j in Sn if j[0] in "H"}
    m = len(M)
    a = len(A)
    r = len(R)
    c = len(C)
    h = len(H)
    print(
        (
            m * a * r
            + m * a * c
            + m * a * h
            + m * r * c
            + m * r * h
            + m * c * h
            + a * r * c
            + a * r * h
            + a * c * h
            + r * c * h
        )
    )
    return


main()

from itertools import combinations

input = open(0).read
Sn = [i[0] for i in input().split() if i[0] in "MARCH"]


def main():
    print(
        (sum(x * y * z for x, y, z in combinations([Sn.count(s) for s in "MARCH"], 3)))
    )
    return


main()

+from itertools import combinations + -N, *Sn = list(map(str, input().split())) -N = int(N) +Sn = [i[0] for i in input().split() if i[0] in "MARCH"] -    M = {j for j in Sn if j[0] in "M"} -    A = {j for j in Sn if j[0] in "A"} -    R = {j for j in Sn if j[0] in "R"} -    C = {j for j in Sn if j[0] in "C"} -    H = {j for j in Sn if j[0] in "H"} -    m = len(M) -    a = len(A) -    r = len(R) -    c = len(C) -    h = len(H) -        ( -            m * a * r -            + m * a * c -            + m * a * h -            + m * r * c -            + m * r * h -            + m * c * h -            + a * r * c -            + a * r * h -            + a * c * h -            + r * c * h -        ) +        (sum(x * y * z for x, y, z in combinations([Sn.count(s) for s in "MARCH"], 3)))