import itertools

N = int(eval(input()))

S = [eval(input()) for _ in range(N)]

caps = ['M', 'A', 'R', 'C', 'H']

a = [0] * 5

ans = 0

for s in S:

    if s[0] in caps:

        a[caps.index(s[0])] += 1

c = list(itertools.combinations((0, 1, 2, 3, 4), 3))

for i in range(len(c)):

    ans += a[c[i][0]] * a[c[i][1]] * a[c[i][2]]

print(ans)
import sys

import itertools

N = int(eval(input()))

S = [sys.stdin.readline() for _ in range(N)]

caps = ['M', 'A', 'R', 'C', 'H']

a = [0] * 5

ans = 0

for s in S:

    if s[0] in caps:

        a[caps.index(s[0])] += 1

c = list(itertools.combinations((0, 1, 2, 3, 4), 3))

for i in range(len(c)):

    ans += a[c[i][0]] * a[c[i][1]] * a[c[i][2]]

print(ans)
import itertools

N = int(eval(input()))
S = [eval(input()) for _ in range(N)]
caps = ["M", "A", "R", "C", "H"]
a = [0] * 5
ans = 0
for s in S:
    if s[0] in caps:
        a[caps.index(s[0])] += 1
c = list(itertools.combinations((0, 1, 2, 3, 4), 3))
for i in range(len(c)):
    ans += a[c[i][0]] * a[c[i][1]] * a[c[i][2]]
print(ans)

import sys
import itertools

N = int(eval(input()))
S = [sys.stdin.readline() for _ in range(N)]
caps = ["M", "A", "R", "C", "H"]
a = [0] * 5
ans = 0
for s in S:
    if s[0] in caps:
        a[caps.index(s[0])] += 1
c = list(itertools.combinations((0, 1, 2, 3, 4), 3))
for i in range(len(c)):
    ans += a[c[i][0]] * a[c[i][1]] * a[c[i][2]]
print(ans)

+import sys -S = [eval(input()) for _ in range(N)] +S = [sys.stdin.readline() for _ in range(N)]