open System

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

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

    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] + 1L)
            | _ -> ()

    let rec dfs (cs: char list) rest =
        match rest with
        | [] ->
            if cs.Length = 3 then
                cs
                |> List.map (fun c -> m.[c])
                |> List.fold (*) 1L
            else
                0L
        | c :: rest ->
            (dfs cs rest) + (dfs (c :: cs) rest)

    dfs [] march

ans |> Console.WriteLine

