from collections import defaultdict

from itertools import combinations



N = int(eval(input()))

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



dic = defaultdict(int)

for s in S:

    dic[s[0]] += 1



comb = combinations("MARCH", 3)



ans = 0

for x1,x2,x3 in comb:

    ans += dic[x1]*dic[x2]*dic[x3]



print(ans)

# Python3 (3.4.3)

import sys

input = sys.stdin.readline



# -------------------------------------------------------------

# function

# -------------------------------------------------------------





# -------------------------------------------------------------

# main

# -------------------------------------------------------------

N = int(eval(input()))

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



from collections import defaultdict

d = defaultdict(int)



for s in S:

    key = s[0]

    d[key] += 1



from itertools import combinations

c = combinations("MARCH",3)

ans = 0

for x,y,z in c:

    ans += d[x]*d[y]*d[z]



print(ans)
from collections import defaultdict
from itertools import combinations

N = int(eval(input()))
S = [eval(input()) for _ in range(N)]
dic = defaultdict(int)
for s in S:
    dic[s[0]] += 1
comb = combinations("MARCH", 3)
ans = 0
for x1, x2, x3 in comb:
    ans += dic[x1] * dic[x2] * dic[x3]
print(ans)

# Python3 (3.4.3)
import sys

input = sys.stdin.readline
# -------------------------------------------------------------
# function
# -------------------------------------------------------------
# -------------------------------------------------------------
# main
# -------------------------------------------------------------
N = int(eval(input()))
S = [input().rstrip() for _ in range(N)]
from collections import defaultdict

d = defaultdict(int)
for s in S:
    key = s[0]
    d[key] += 1
from itertools import combinations

c = combinations("MARCH", 3)
ans = 0
for x, y, z in c:
    ans += d[x] * d[y] * d[z]
print(ans)

+# Python3 (3.4.3) +import sys + +input = sys.stdin.readline +# function +# main +N = int(eval(input())) +S = [input().rstrip() for _ in range(N)] + +d = defaultdict(int) +for s in S: +    key = s[0] +    d[key] += 1 -N = int(eval(input())) -S = [eval(input()) for _ in range(N)] -dic = defaultdict(int) -for s in S: -    dic[s[0]] += 1 -comb = combinations("MARCH", 3) +c = combinations("MARCH", 3) -for x1, x2, x3 in comb: -    ans += dic[x1] * dic[x2] * dic[x3] +for x, y, z in c: +    ans += d[x] * d[y] * d[z]