object Main {
  def main(args: Array[String]): Unit = {
    val Array(problem_num, answer_num) = io.StdIn.readLine.split(" ").map{_.toInt}

    var count = 0
    var problem = Vector.empty[Tuple2[Int, String]]

    while(count < answer_num) {
      val Array(ans_num, pass_or_fail) = io.StdIn.readLine.split(" ")
      problem = problem :+ (ans_num.toInt, pass_or_fail)
      count += 1
    }

    var check_num = 0
    var check = false
    var fail_count = 0
    var pass_count = 0
    problem.sortBy(_._1).foreach { i =>
      if ( check_num != i._1 ) {
        check_num = i._1
        check = false
      }

      if(!check) {
        if(i._2 == "AC") {
          pass_count += 1
          check = true
        }
        else {
          fail_count += 1
        }
      }
    }
    println(pass_count.toString + " " + fail_count.toString)
  }
}