let () = Scanf.scanf "%d %d\n" @@ fun n m ->
  let pss = Array.init m @@ fun _ -> Scanf.scanf "%d %s\n" @@ fun p s -> p, s in
  let ac = Array.make n false in
  let wa = Array.make n 0 in
  Array.iter (fun (p, s) ->
    if not ac.(p - 1) then begin
      if s = "AC"
      then ac.(p - 1) <- true
      else wa.(p - 1) <- 1 + wa.(p - 1)
    end) pss;
  Printf.printf "%d %d\n"
  (Array.fold_right (fun b -> ( + ) @@ if b then 1 else 0) ac 0) @@
  Array.fold_left ( + ) 0 @@
  Array.init n @@ fun i -> if ac.(i) then wa.(i) else 0
