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