N = int(eval(input()))



count = {

    'M' : 0,

    'A' : 0,

    'R' : 0,

    'C' : 0,

    'H' : 0,

}



for _ in range(N):

    s = eval(input())

    if s[0] in count:

        count[s[0]] += 1



ans = 0

count = list(count.items())

for i in range(len(count)):

    for j in range(i + 1, len(count)):

        for k in range(j + 1, len(count)):

            ans += count[i][1] * count[j][1] * count[k][1]



print(ans)
from itertools import combinations

from collections import defaultdict

import sys

input = sys.stdin.readline



N = int(eval(input()))

cnt = defaultdict(int)

for _ in range(N):

    s = eval(input())

    cnt[s[0]] += 1



ans = 0

for h in combinations(['M', 'A', 'R', 'C', 'H'], r=3):

    prd = 1

    for s in h:

        prd *= cnt[s]

    ans += prd

print(ans)

N = int(eval(input()))
count = {
    "M": 0,
    "A": 0,
    "R": 0,
    "C": 0,
    "H": 0,
}
for _ in range(N):
    s = eval(input())
    if s[0] in count:
        count[s[0]] += 1
ans = 0
count = list(count.items())
for i in range(len(count)):
    for j in range(i + 1, len(count)):
        for k in range(j + 1, len(count)):
            ans += count[i][1] * count[j][1] * count[k][1]
print(ans)

from itertools import combinations
from collections import defaultdict
import sys

input = sys.stdin.readline
N = int(eval(input()))
cnt = defaultdict(int)
for _ in range(N):
    s = eval(input())
    cnt[s[0]] += 1
ans = 0
for h in combinations(["M", "A", "R", "C", "H"], r=3):
    prd = 1
    for s in h:
        prd *= cnt[s]
    ans += prd
print(ans)

+from itertools import combinations +from collections import defaultdict +import sys + +input = sys.stdin.readline -count = { -    "M": 0, -    "A": 0, -    "R": 0, -    "C": 0, -    "H": 0, -} +cnt = defaultdict(int) -    if s[0] in count: -        count[s[0]] += 1 +    cnt[s[0]] += 1 -count = list(count.items()) -for i in range(len(count)): -    for j in range(i + 1, len(count)): -        for k in range(j + 1, len(count)): -            ans += count[i][1] * count[j][1] * count[k][1] +for h in combinations(["M", "A", "R", "C", "H"], r=3): +    prd = 1 +    for s in h: +        prd *= cnt[s] +    ans += prd