object Main extends App {
  
  val sc = new java.util.Scanner(System.in)
  val n, m = sc.nextInt()
  val a = List.fill(m)((sc.nextInt, sc.next))
    .groupBy(_._1).map{ case (x, y) => x -> y.map(_._2)}
  val ac = a.filter{case (k, v) => v.contains("AC")}.size
  val wa = a.values.map(v => {
    val index = v.indexOf("AC")
    if (index == -1) 0 else index
  }).sum
  println(s"$ac $wa")
}