open System

let n = Console.ReadLine() |> int
let ss =
    seq {
        for i in 1 .. n do
            yield Console.ReadLine()
    }

let ans =
    let march = ['M'; 'A'; 'R'; 'C'; 'H']
    let mutable m =
        new Map<char, int> (
            march
            |> List.toSeq
            |> Seq.map (fun c -> (c, 0))
        )

    for s in ss do
        let c = s.[0]
        match List.tryFind (fun x -> x = c) march with
            | Some _ -> m <- m |> Map.add c (m.[c] + 1)
            | _ -> ()

    let tmp =
        march
        |> List.map (fun c -> m.[c])
        |> List.filter (fun x -> x >= 1)

    let rec dfs (is: int list) rest =
        match rest with
        | [] ->
            if is.Length = 3 then
                is
                |> List.map (fun i -> tmp.[i])
                |> List.fold (*) 1
            else
                0
        | i :: rest ->
            (dfs is rest) + (dfs (i :: is) rest)

    dfs [] [0 .. tmp.Length - 1]

ans |> Console.WriteLine

