# ABC089C - March

from itertools import combinations





def main():

    n = int(eval(input()))

    lst = [input().rstrip() for _ in range(n)]

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

    for i in lst:

        if i[0] in "MARCH":

            cond[i[0]] += 1

    ans = 0

    for x, y, z in combinations("MARCH", 3):

        ans += cond[x] * cond[y] * cond[z]

    print(ans)





if __name__ == "__main__":

    main()
# ABC089C - March

import sys

input = sys.stdin.readline



from itertools import combinations





def main():

    n = int(eval(input()))

    lst = [input().rstrip() for _ in range(n)]

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

    for i in lst:

        if i[0] in "MARCH":

            cond[i[0]] += 1

    ans = 0

    for x, y, z in combinations("MARCH", 3):

        ans += cond[x] * cond[y] * cond[z]

    print(ans)





if __name__ == "__main__":

    main()
# ABC089C - March
from itertools import combinations


def main():
    n = int(eval(input()))
    lst = [input().rstrip() for _ in range(n)]
    cond = {"M": 0, "A": 0, "R": 0, "C": 0, "H": 0}
    for i in lst:
        if i[0] in "MARCH":
            cond[i[0]] += 1
    ans = 0
    for x, y, z in combinations("MARCH", 3):
        ans += cond[x] * cond[y] * cond[z]
    print(ans)


if __name__ == "__main__":
    main()

# ABC089C - March
import sys

input = sys.stdin.readline
from itertools import combinations


def main():
    n = int(eval(input()))
    lst = [input().rstrip() for _ in range(n)]
    cond = {"M": 0, "A": 0, "R": 0, "C": 0, "H": 0}
    for i in lst:
        if i[0] in "MARCH":
            cond[i[0]] += 1
    ans = 0
    for x, y, z in combinations("MARCH", 3):
        ans += cond[x] * cond[y] * cond[z]
    print(ans)


if __name__ == "__main__":
    main()

+import sys + +input = sys.stdin.readline