import java.util.Scanner

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

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