let a_s, ws, w, m = Scanf.scanf "%d %d" @@ fun n m -> Array.(make (n + 1) 0, make (n + 1) 0, ref 0, m)
let _ = for _ = 1 to m do Scanf.scanf " %d %s" @@ fun p s -> if a_s.(p) = 0 then if s = "AC" then (a_s.(p) <- 1; w := !w + ws.(p)) else ws.(p) <- ws.(p) + 1 done; Printf.printf "%d %d\n" (Array.fold_left (+) 0 a_s) !w