open System
open System.Collections
open System.Collections.Generic
open System.IO
open System.Linq

let read() = Console.ReadLine()

[<EntryPoint>]
let main _ = 
    let N = read() |> int
    let S = 
        Array.init N (fun _ -> read().First())
    
    let ans = 
        let cnt(c) = 
            S
            |> Array.filter(fun x-> x =c)
            |> Array.length
            |> int64
        let a = cnt('M') 
        let b = cnt('A') 
        let c = cnt('R')
        let d = cnt('C')
        let e = cnt('H')
        a*b*c + a*b*d + a*b*e + a*c*d + a*c*e + a*d*e
        + b*c*d + b*c*e + b*d*e
        + c*d*e
    
    printfn "%i" ans
    0

