open Hashtbl
let n = read_int ()
let ss = Array.init n @@ fun _ -> read_line ()
let h, ks, ans = create 5, [|'M'; 'A'; 'R'; 'C'; 'H'|], ref 0
let f i = try find h ks.(i) with _ -> 0
let _ = Array.iter (fun s -> replace h s.[0] @@ try find h s.[0] + 1 with _ -> 1) ss;
  for i = 0 to 4 do for j = i + 1 to 4 do for k = j + 1 to 4 do ans := !ans + f i * f j * f k done done done; Printf.printf "%d\n" !ans