import java.util.Scanner

object Main extends App {
  val sc = new Scanner(System.in)
  val n, m = sc.nextInt
  val submissions: Array[(Long, Boolean)] = Array.fill(m)(sc.nextLong, "AC".equals(sc.next))
  var acQuestions: Set[Long] = Set()
  var penaltyQuestions: Map[Long, Long] = Map()
  for (submission <- submissions) {
    if (!acQuestions.contains(submission._1) && !submission._2) {
      val org = penaltyQuestions.getOrElse(submission._1, 0L)
      penaltyQuestions = penaltyQuestions + (submission._1 -> (org + 1L))
    }
    if (submission._2) {
      acQuestions = acQuestions + submission._1
    }
  }

  println(acQuestions.size + " " + penaltyQuestions.size)
}