N = int(eval(input()))

Name = [input()[0] for _ in range(N)]

March = {x:Name.count(x) for x in 'MARCH' if Name.count(x) > 0}



import itertools

ans = 0

for x,y,z in itertools.combinations(list(March.values()), 3):

    ans += x*y*z

print(ans)
from collections import Counter

from itertools import combinations, starmap

func = lambda x, y, z: x*y*z



def main():

    with open(0) as f:

        N, *S = f.read().split()

    S = [s[0] for s in S if s[0] in list('MARCH')]

    S = Counter(S)

    ans = sum(starmap(func, combinations(list(S.values()), 3)))

    print(ans)



main()
N = int(eval(input()))
Name = [input()[0] for _ in range(N)]
March = {x: Name.count(x) for x in "MARCH" if Name.count(x) > 0}
import itertools

ans = 0
for x, y, z in itertools.combinations(list(March.values()), 3):
    ans += x * y * z
print(ans)

from collections import Counter
from itertools import combinations, starmap

func = lambda x, y, z: x * y * z


def main():
    with open(0) as f:
        N, *S = f.read().split()
    S = [s[0] for s in S if s[0] in list("MARCH")]
    S = Counter(S)
    ans = sum(starmap(func, combinations(list(S.values()), 3)))
    print(ans)


main()

-N = int(eval(input())) -Name = [input()[0] for _ in range(N)] -March = {x: Name.count(x) for x in "MARCH" if Name.count(x) > 0} -import itertools +from collections import Counter +from itertools import combinations, starmap -ans = 0 -for x, y, z in itertools.combinations(list(March.values()), 3): -    ans += x * y * z -print(ans) +func = lambda x, y, z: x * y * z + + +def main(): +    with open(0) as f: +        N, *S = f.read().split() +    S = [s[0] for s in S if s[0] in list("MARCH")] +    S = Counter(S) +    ans = sum(starmap(func, combinations(list(S.values()), 3))) +    print(ans) + + +main()