object Main extends App {
  val Array(n,m) = readLine.split(" ").map{_.toInt}
  val ac:Array[Int] = Array.fill(n+1)(0)
  val wa:Array[Int] = Array.fill(n+1)(0)
  
  (1 to m).foreach { _ =>
    val input = """(\d+) ([A-Z]+)""".r
    readLine match {
      case input(p,s) => {
        if (ac(p.toInt)==0) {
          s match {
            case "AC" => ac(p.toInt) += 1
            case "WA" => wa(p.toInt) += 1
          }
        }
      }
    }
  }
  
  println(s"${ac.sum} ${wa.sum}")
}