# -*- coding: utf-8 -*-

from itertools import combinations

N = int(eval(input()))

C = [0, 0, 0, 0, 0]

march = set(list("MARCH"))

for _ in range(N):

    S = input()[0]

    if S in march:

        C["MARCH".index(S)] += 1



ans = 0

for a, b, c in combinations(list(range(5)), r=3):

    ans += C[a]*C[b]*C[c]

print(ans)

# -*- coding: utf-8 -*-

from collections import defaultdict

from itertools import combinations

N = int(eval(input()))

C = [0, 0, 0, 0, 0, 0]

D = defaultdict(int)

for i, m in enumerate("MARCH", start=1):

    D[m] = i



for _ in range(N):

    C[D[input()[0]]] += 1



ans = 0

for a, b, c in combinations(list(range(1, 6)), r=3):

    ans += C[a]*C[b]*C[c]

print(ans)
# -*- coding: utf-8 -*-
from itertools import combinations

N = int(eval(input()))
C = [0, 0, 0, 0, 0]
march = set(list("MARCH"))
for _ in range(N):
    S = input()[0]
    if S in march:
        C["MARCH".index(S)] += 1
ans = 0
for a, b, c in combinations(list(range(5)), r=3):
    ans += C[a] * C[b] * C[c]
print(ans)

# -*- coding: utf-8 -*-
from collections import defaultdict
from itertools import combinations

N = int(eval(input()))
C = [0, 0, 0, 0, 0, 0]
D = defaultdict(int)
for i, m in enumerate("MARCH", start=1):
    D[m] = i
for _ in range(N):
    C[D[input()[0]]] += 1
ans = 0
for a, b, c in combinations(list(range(1, 6)), r=3):
    ans += C[a] * C[b] * C[c]
print(ans)

+from collections import defaultdict -C = [0, 0, 0, 0, 0] -march = set(list("MARCH")) +C = [0, 0, 0, 0, 0, 0] +D = defaultdict(int) +for i, m in enumerate("MARCH", start=1): +    D[m] = i -    S = input()[0] -    if S in march: -        C["MARCH".index(S)] += 1 +    C[D[input()[0]]] += 1 -for a, b, c in combinations(list(range(5)), r=3): +for a, b, c in combinations(list(range(1, 6)), r=3):