object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val n,m = sc.nextInt
  val seq = Seq.fill(m)((sc.nextInt, sc.next)).toVector
  
  var acList = Seq[Int]()
  var filterd = Seq[String]()
  
  for ((i, v) <- seq) {
    if (!acList.contains(i)) {
      filterd = filterd :+ v
      if (v == "AC") acList = acList :+ i
    }
  }
  println(s"${filterd.count(_ == "AC")} ${filterd.count(_ == "WA")}")
}