from itertools import combinations



N = int(eval(input()))

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



cnt = [sum(v[0] == c for v in s) for c in 'MARCH']

ans = sum(cnt[i] * cnt[j] * cnt[k] for i, j, k in combinations(list(range(5)), 3))

print(ans)
from itertools import combinations

from collections import Counter



N = int(eval(input()))

cnt = Counter([input()[0] for _ in range(N)])

ans = sum(cnt[i] * cnt[j] * cnt[k] for i, j, k in combinations('MARCH', 3))

print(ans)
from itertools import combinations

N = int(eval(input()))
s = [eval(input()) for _ in range(N)]
cnt = [sum(v[0] == c for v in s) for c in "MARCH"]
ans = sum(cnt[i] * cnt[j] * cnt[k] for i, j, k in combinations(list(range(5)), 3))
print(ans)

from itertools import combinations
from collections import Counter

N = int(eval(input()))
cnt = Counter([input()[0] for _ in range(N)])
ans = sum(cnt[i] * cnt[j] * cnt[k] for i, j, k in combinations("MARCH", 3))
print(ans)

+from collections import Counter -s = [eval(input()) for _ in range(N)] -cnt = [sum(v[0] == c for v in s) for c in "MARCH"] -ans = sum(cnt[i] * cnt[j] * cnt[k] for i, j, k in combinations(list(range(5)), 3)) +cnt = Counter([input()[0] for _ in range(N)]) +ans = sum(cnt[i] * cnt[j] * cnt[k] for i, j, k in combinations("MARCH", 3))