from collections import Counter

from itertools import combinations

n = int(eval(input()))

S = [input()[0] for _ in range(n)]

C = Counter(S)

ans = 0

for i, j, k in combinations(['M', 'A', 'R', 'C', 'H'], 3):

    ans += C[i] * C[j] * C[k]

print(ans)

from collections import defaultdict

from itertools import combinations

def main():

    n = int(eval(input()))

    d = defaultdict(int)

    for _ in range(n):

        s = eval(input())

        d[s[0]] += 1

    ans = 0

    for i, j, k in combinations('MARCH', 3):

        ans += d[i] * d[j] * d[k]

    print(ans)



if __name__ == '__main__':

    main()

from collections import Counter
from itertools import combinations

n = int(eval(input()))
S = [input()[0] for _ in range(n)]
C = Counter(S)
ans = 0
for i, j, k in combinations(["M", "A", "R", "C", "H"], 3):
    ans += C[i] * C[j] * C[k]
print(ans)

from collections import defaultdict
from itertools import combinations


def main():
    n = int(eval(input()))
    d = defaultdict(int)
    for _ in range(n):
        s = eval(input())
        d[s[0]] += 1
    ans = 0
    for i, j, k in combinations("MARCH", 3):
        ans += d[i] * d[j] * d[k]
    print(ans)


if __name__ == "__main__":
    main()

-from collections import Counter +from collections import defaultdict -n = int(eval(input())) -S = [input()[0] for _ in range(n)] -C = Counter(S) -ans = 0 -for i, j, k in combinations(["M", "A", "R", "C", "H"], 3): -    ans += C[i] * C[j] * C[k] -print(ans) + +def main(): +    n = int(eval(input())) +    d = defaultdict(int) +    for _ in range(n): +        s = eval(input()) +        d[s[0]] += 1 +    ans = 0 +    for i, j, k in combinations("MARCH", 3): +        ans += d[i] * d[j] * d[k] +    print(ans) + + +if __name__ == "__main__": +    main()