from itertools import combinations



N = int(eval(input()))



target = 'MARCH'

first = [0 for _ in range(5)]

for _ in range(N):

    s = eval(input())

    if s[0] in target:

        first[target.find(s[0])] += 1



res = 0

for c in combinations(first, 3):

    res += c[0]*c[1]*c[2]

    

print(res)

from itertools import combinations

from sys import stdin





ns = lambda: stdin.readline()

ni = lambda: int(stdin.readline())

na = lambda: list(map(int, stdin.readline().split()))



N = ni()



target = 'MARCH'

first = [0 for _ in range(5)]

for _ in range(N):

    s = ns()

    if s[0] in target:

        first[target.find(s[0])] += 1



res = 0

for c in combinations(first, 3):

    res += c[0]*c[1]*c[2]

    

print(res)

from itertools import combinations

N = int(eval(input()))
target = "MARCH"
first = [0 for _ in range(5)]
for _ in range(N):
    s = eval(input())
    if s[0] in target:
        first[target.find(s[0])] += 1
res = 0
for c in combinations(first, 3):
    res += c[0] * c[1] * c[2]
print(res)

from itertools import combinations
from sys import stdin

ns = lambda: stdin.readline()
ni = lambda: int(stdin.readline())
na = lambda: list(map(int, stdin.readline().split()))
N = ni()
target = "MARCH"
first = [0 for _ in range(5)]
for _ in range(N):
    s = ns()
    if s[0] in target:
        first[target.find(s[0])] += 1
res = 0
for c in combinations(first, 3):
    res += c[0] * c[1] * c[2]
print(res)

+from sys import stdin -N = int(eval(input())) +ns = lambda: stdin.readline() +ni = lambda: int(stdin.readline()) +na = lambda: list(map(int, stdin.readline().split())) +N = ni() -    s = eval(input()) +    s = ns()