import sys



def solve():

    input = sys.stdin.readline

    nameCount = [0] * 5

    N = int(eval(input()))

    for _ in range(N):

        s = input().strip("\n")

        if s[0] == "M": nameCount[0] += 1

        elif s[0] == "A": nameCount[1] += 1

        elif s[0] == "R": nameCount[2] += 1

        elif s[0] == "C": nameCount[3] += 1

        elif s[0] == "H": nameCount[4] += 1

        else: continue

    Ans = 0

    for i in range(3):

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

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

                Ans += nameCount[i] * nameCount[j] * nameCount[k]

    print(Ans)





    return 0



if __name__ == "__main__":

    solve()
import sys



def solve():

    input = sys.stdin.readline

    N = int(eval(input()))

    D = dict()

    W = ["M", "A", "R", "C", "H"]

    for w in W: D[w] = 0

    for _ in range(N):

        S = input().strip("\n")

        if S[0] in W:

            D[S[0]] += 1

    

    ans = 0

    for i in range(3):

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

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

                ans += D[W[i]] * D[W[j]] * D[W[k]]

    print(ans)



    return 0



if __name__ == "__main__":

    solve()
import sys


def solve():
    input = sys.stdin.readline
    nameCount = [0] * 5
    N = int(eval(input()))
    for _ in range(N):
        s = input().strip("\n")
        if s[0] == "M":
            nameCount[0] += 1
        elif s[0] == "A":
            nameCount[1] += 1
        elif s[0] == "R":
            nameCount[2] += 1
        elif s[0] == "C":
            nameCount[3] += 1
        elif s[0] == "H":
            nameCount[4] += 1
        else:
            continue
    Ans = 0
    for i in range(3):
        for j in range(i + 1, 4):
            for k in range(j + 1, 5):
                Ans += nameCount[i] * nameCount[j] * nameCount[k]
    print(Ans)
    return 0


if __name__ == "__main__":
    solve()

import sys


def solve():
    input = sys.stdin.readline
    N = int(eval(input()))
    D = dict()
    W = ["M", "A", "R", "C", "H"]
    for w in W:
        D[w] = 0
    for _ in range(N):
        S = input().strip("\n")
        if S[0] in W:
            D[S[0]] += 1
    ans = 0
    for i in range(3):
        for j in range(i + 1, 4):
            for k in range(j + 1, 5):
                ans += D[W[i]] * D[W[j]] * D[W[k]]
    print(ans)
    return 0


if __name__ == "__main__":
    solve()

-    nameCount = [0] * 5 +    D = dict() +    W = ["M", "A", "R", "C", "H"] +    for w in W: +        D[w] = 0 -        s = input().strip("\n") -        if s[0] == "M": -            nameCount[0] += 1 -        elif s[0] == "A": -            nameCount[1] += 1 -        elif s[0] == "R": -            nameCount[2] += 1 -        elif s[0] == "C": -            nameCount[3] += 1 -        elif s[0] == "H": -            nameCount[4] += 1 -        else: -            continue -    Ans = 0 +        S = input().strip("\n") +        if S[0] in W: +            D[S[0]] += 1 +    ans = 0 -                Ans += nameCount[i] * nameCount[j] * nameCount[k] -    print(Ans) +                ans += D[W[i]] * D[W[j]] * D[W[k]] +    print(ans)