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