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))
  
  var acList = Seq[Int]()
  var ac = 0
  var wa = 0
  
  for ((i, v) <- seq) {
    if (!acList.contains(i)) {
      if (v == "WA") wa = wa + 1
      if (v == "AC") {
        ac = ac + 1
        acList = acList :+ i
      }
    }
  }
  println(s"$ac $wa")
}