from collections import defaultdict, Counter

from itertools import product, groupby, count, permutations, combinations

from math import pi, sqrt

from collections import deque

from bisect import bisect, bisect_left, bisect_right

from string import ascii_lowercase

from functools import lru_cache

INF = float("inf")

import sys

sys.setrecursionlimit(10000)





def solve(N, S):

    d = Counter([s[0] for s in S if s[0] in "MARCH"])

    ans = 0

    for comb in combinations("MARCH", 3):

        a = 1

        for c in comb:

            a *= d[c]

        ans += a

    return ans





def main():

    N = int(eval(input()))

    S = []

    for i in range(0, N):

        S.append(eval(input()))

    print((solve(N, S)))





if __name__ == '__main__':

    main()

#!/usr/bin/python3



from collections import defaultdict, Counter

from itertools import product, groupby, count, permutations, combinations

from math import pi, sqrt

from collections import deque

from bisect import bisect, bisect_left, bisect_right

from string import ascii_lowercase

from functools import lru_cache

import sys

sys.setrecursionlimit(10000)

INF = float("inf")

YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"

dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]





def inside(y, x, H, W):

    return 0 <= y < H and 0 <= x < W





def main():

    N = int(eval(input()))

    d = defaultdict(int)

    for _ in range(N):

        s = eval(input())

        d[s[0]] += 1



    ans = 0

    for a in combinations("MARCH", 3):

        ans += d[a[0]] * d[a[1]] * d[a[2]]



    print(ans)





if __name__ == '__main__':

    main()

from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache

INF = float("inf")
import sys

sys.setrecursionlimit(10000)


def solve(N, S):
    d = Counter([s[0] for s in S if s[0] in "MARCH"])
    ans = 0
    for comb in combinations("MARCH", 3):
        a = 1
        for c in comb:
            a *= d[c]
        ans += a
    return ans


def main():
    N = int(eval(input()))
    S = []
    for i in range(0, N):
        S.append(eval(input()))
    print((solve(N, S)))


if __name__ == "__main__":
    main()

#!/usr/bin/python3
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys

sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


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


if __name__ == "__main__":
    main()

+#!/usr/bin/python3 - -INF = float("inf") +INF = float("inf") +YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no" +dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0] -def solve(N, S): -    d = Counter([s[0] for s in S if s[0] in "MARCH"]) -    ans = 0 -    for comb in combinations("MARCH", 3): -        a = 1 -        for c in comb: -            a *= d[c] -        ans += a -    return ans +def inside(y, x, H, W): +    return 0 <= y < H and 0 <= x < W -    S = [] -    for i in range(0, N): -        S.append(eval(input())) -    print((solve(N, S))) +    d = defaultdict(int) +    for _ in range(N): +        s = eval(input()) +        d[s[0]] += 1 +    ans = 0 +    for a in combinations("MARCH", 3): +        ans += d[a[0]] * d[a[1]] * d[a[2]] +    print(ans)