# ABC089C - March

from itertools import combinations





def main():

    n = int(eval(input()))

    lst = [input().rstrip()[0] for _ in range(n)]

    cand = [lst.count(s) for s in "MARCH"]

    ans = sum(x * y * z for x, y, z in combinations(cand, 3))

    print(ans)





if __name__ == "__main__":

    main()
# ABC089C - March

import sys

input = sys.stdin.readline



from itertools import combinations





def main():

    n = int(eval(input()))

    lst = [input().rstrip()[0] for _ in range(n)]

    cand = [lst.count(s) for s in "MARCH"]

    ans = sum(x * y * z for x, y, z in combinations(cand, 3))

    print(ans)





if __name__ == "__main__":

    main()
# ABC089C - March
from itertools import combinations


def main():
    n = int(eval(input()))
    lst = [input().rstrip()[0] for _ in range(n)]
    cand = [lst.count(s) for s in "MARCH"]
    ans = sum(x * y * z for x, y, z in combinations(cand, 3))
    print(ans)


if __name__ == "__main__":
    main()

# ABC089C - March
import sys

input = sys.stdin.readline
from itertools import combinations


def main():
    n = int(eval(input()))
    lst = [input().rstrip()[0] for _ in range(n)]
    cand = [lst.count(s) for s in "MARCH"]
    ans = sum(x * y * z for x, y, z in combinations(cand, 3))
    print(ans)


if __name__ == "__main__":
    main()

+import sys + +input = sys.stdin.readline