def main():

    N = int(eval(input()))

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

    from itertools import combinations

    S = {"M": 0, "A": 1, "R": 2, "C": 3, "H": 4}

    ans = 0

    cnt = [0]*5

    for a in A:

        c = a[0]

        if c in list(S.keys()):

            cnt[S[c]] += 1

    for comb in combinations(list(range(5)), 3):

        ans += cnt[comb[0]]*cnt[comb[1]]*cnt[comb[2]]

    print(ans)





if __name__ == '__main__':

    main()

def main():

    N = int(eval(input()))

    A = [input()[0] for i in range(N)]

    from collections import Counter

    from itertools import combinations

    c = Counter(A)

    d = ('M', 'A', 'R', 'C', 'H')

    ans = 0

    for (a1, a2, a3) in combinations(d, 3):

        ans += c[a1] * c[a2] * c[a3]

    print(ans)





if __name__ == '__main__':

    main()

def main():
    N = int(eval(input()))
    A = [eval(input()) for i in range(N)]
    from itertools import combinations

    S = {"M": 0, "A": 1, "R": 2, "C": 3, "H": 4}
    ans = 0
    cnt = [0] * 5
    for a in A:
        c = a[0]
        if c in list(S.keys()):
            cnt[S[c]] += 1
    for comb in combinations(list(range(5)), 3):
        ans += cnt[comb[0]] * cnt[comb[1]] * cnt[comb[2]]
    print(ans)


if __name__ == "__main__":
    main()

def main():
    N = int(eval(input()))
    A = [input()[0] for i in range(N)]
    from collections import Counter
    from itertools import combinations

    c = Counter(A)
    d = ("M", "A", "R", "C", "H")
    ans = 0
    for (a1, a2, a3) in combinations(d, 3):
        ans += c[a1] * c[a2] * c[a3]
    print(ans)


if __name__ == "__main__":
    main()

-    A = [eval(input()) for i in range(N)] +    A = [input()[0] for i in range(N)] +    from collections import Counter -    S = {"M": 0, "A": 1, "R": 2, "C": 3, "H": 4} +    c = Counter(A) +    d = ("M", "A", "R", "C", "H") -    cnt = [0] * 5 -    for a in A: -        c = a[0] -        if c in list(S.keys()): -            cnt[S[c]] += 1 -    for comb in combinations(list(range(5)), 3): -        ans += cnt[comb[0]] * cnt[comb[1]] * cnt[comb[2]] +    for (a1, a2, a3) in combinations(d, 3): +        ans += c[a1] * c[a2] * c[a3]