def main():

    N = int(eval(input()))



    cnt = [0]*5

    for i in range(N):

        S = eval(input())

        if S[0] == 'M':

            cnt[0] += 1

        if S[0] == 'A':

            cnt[1] += 1

        if S[0] == 'R':

            cnt[2] += 1

        if S[0] == 'C':

            cnt[3] += 1

        if S[0] == 'H':

            cnt[4] += 1



    ans = 0

    for i in range(3):

        for j in range(i+1, 4):

            for k in range(j+1, 5):

                ans += cnt[i] * cnt[j] * cnt[k]



    print(ans)





main()

import sys



readline = sys.stdin.buffer.readline

readlines = sys.stdin.buffer.readlines





def main():

    N = int(readline())

    S = list([x.decode("UTF-8") for x in readlines()])

    S = list([x.rstrip('\n') for x in S])

    march = list("MARCH")



    cnt = [0] * 5

    for i in range(N):

        for j in range(5):

            if S[i][0] == march[j]:

                cnt[j] += 1



    ans = 0



    if N < 3:

        print((0))

    else:

        for i in range(3):

            for j in range(i+1, 4):

                for k in range(j+1, 5):

                    ans += cnt[i] * cnt[j] * cnt[k]



        print(ans)





main()

def main():
    N = int(eval(input()))
    cnt = [0] * 5
    for i in range(N):
        S = eval(input())
        if S[0] == "M":
            cnt[0] += 1
        if S[0] == "A":
            cnt[1] += 1
        if S[0] == "R":
            cnt[2] += 1
        if S[0] == "C":
            cnt[3] += 1
        if S[0] == "H":
            cnt[4] += 1
    ans = 0
    for i in range(3):
        for j in range(i + 1, 4):
            for k in range(j + 1, 5):
                ans += cnt[i] * cnt[j] * cnt[k]
    print(ans)


main()

import sys

readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines


def main():
    N = int(readline())
    S = list([x.decode("UTF-8") for x in readlines()])
    S = list([x.rstrip("\n") for x in S])
    march = list("MARCH")
    cnt = [0] * 5
    for i in range(N):
        for j in range(5):
            if S[i][0] == march[j]:
                cnt[j] += 1
    ans = 0
    if N < 3:
        print((0))
    else:
        for i in range(3):
            for j in range(i + 1, 4):
                for k in range(j + 1, 5):
                    ans += cnt[i] * cnt[j] * cnt[k]
        print(ans)


main()

+import sys + +readline = sys.stdin.buffer.readline +readlines = sys.stdin.buffer.readlines + + -    N = int(eval(input())) +    N = int(readline()) +    S = list([x.decode("UTF-8") for x in readlines()]) +    S = list([x.rstrip("\n") for x in S]) +    march = list("MARCH") -        S = eval(input()) -        if S[0] == "M": -            cnt[0] += 1 -        if S[0] == "A": -            cnt[1] += 1 -        if S[0] == "R": -            cnt[2] += 1 -        if S[0] == "C": -            cnt[3] += 1 -        if S[0] == "H": -            cnt[4] += 1 +        for j in range(5): +            if S[i][0] == march[j]: +                cnt[j] += 1 -    for i in range(3): -        for j in range(i + 1, 4): -            for k in range(j + 1, 5): -                ans += cnt[i] * cnt[j] * cnt[k] -    print(ans) +    if N < 3: +        print((0)) +    else: +        for i in range(3): +            for j in range(i + 1, 4): +                for k in range(j + 1, 5): +                    ans += cnt[i] * cnt[j] * cnt[k] +        print(ans)