# ABC089C - March

from itertools import combinations as comb





def main():

    N, *S = open(0).read().split()

    cnt = [sum(s.startswith(i) for s in S) for i in "MARCH"]

    ans = sum(x * y * z for x, y, z in comb(cnt, 3))

    print(ans)





if __name__ == "__main__":

    main()
# ABC089C - March

from itertools import combinations as comb





def main():

    N, *S = open(0).read().split()

    capitals = [s[0] for s in S]

    cnt = [capitals.count(i) for i in "MARCH"]

    ans = sum(x * y * z for x, y, z in comb(cnt, 3))

    print(ans)





if __name__ == "__main__":

    main()
# ABC089C - March
from itertools import combinations as comb


def main():
    N, *S = open(0).read().split()
    cnt = [sum(s.startswith(i) for s in S) for i in "MARCH"]
    ans = sum(x * y * z for x, y, z in comb(cnt, 3))
    print(ans)


if __name__ == "__main__":
    main()

# ABC089C - March
from itertools import combinations as comb


def main():
    N, *S = open(0).read().split()
    capitals = [s[0] for s in S]
    cnt = [capitals.count(i) for i in "MARCH"]
    ans = sum(x * y * z for x, y, z in comb(cnt, 3))
    print(ans)


if __name__ == "__main__":
    main()

-    cnt = [sum(s.startswith(i) for s in S) for i in "MARCH"] +    capitals = [s[0] for s in S] +    cnt = [capitals.count(i) for i in "MARCH"]