from itertools import combinations as cmbs

from sys import stdin

c = {"M":0,"A":0,"R":0,"C":0,"H":0}

for si in [s[0] for s in stdin]:

    if si in c:

        c[si] += 1

print((sum(i*j*k for i,j,k in cmbs(list(c.values()),r=3))))

from itertools import combinations as cmbs

from sys import stdin





def main():

    c = {"M":0,"A":0,"R":0,"C":0,"H":0}

    for si in [s[0] for s in stdin]:

        if si in c:

            c[si] += 1

    print((sum(i*j*k for i,j,k in cmbs(list(c.values()),r=3))))





main()

from itertools import combinations as cmbs
from sys import stdin

c = {"M": 0, "A": 0, "R": 0, "C": 0, "H": 0}
for si in [s[0] for s in stdin]:
    if si in c:
        c[si] += 1
print((sum(i * j * k for i, j, k in cmbs(list(c.values()), r=3))))

from itertools import combinations as cmbs
from sys import stdin


def main():
    c = {"M": 0, "A": 0, "R": 0, "C": 0, "H": 0}
    for si in [s[0] for s in stdin]:
        if si in c:
            c[si] += 1
    print((sum(i * j * k for i, j, k in cmbs(list(c.values()), r=3))))


main()

-c = {"M": 0, "A": 0, "R": 0, "C": 0, "H": 0} -for si in [s[0] for s in stdin]: -    if si in c: -        c[si] += 1 -print((sum(i * j * k for i, j, k in cmbs(list(c.values()), r=3)))) + +def main(): +    c = {"M": 0, "A": 0, "R": 0, "C": 0, "H": 0} +    for si in [s[0] for s in stdin]: +        if si in c: +            c[si] += 1 +    print((sum(i * j * k for i, j, k in cmbs(list(c.values()), r=3)))) + + +main()