import java.util.Scanner

object Main extends App {
  val sc = new Scanner(System.in)
  val n, m = sc.nextInt
  val submissions: List[(Int, Boolean)] =
    List.fill(m)(sc.nextInt, "AC".equals(sc.next))

  var ac: Set[Int] = Set()
  var pena: Map[Int, Int] = Map()
  for (submission <- submissions) {
    if (submission._2) {
      ac += submission._1
    } else if (!ac.contains(submission._1)) {
      val org = pena.getOrElse(submission._1, 0)
      pena += (submission._1 -> (org + 1))
    }
  }

  println(s"${ac.size} ${pena.count(q => ac.contains(q._1))}")
}
