object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val n,m = sc.nextInt
  val seq = Seq.fill(m)((sc.nextInt, sc.next))
  
  val grouped = seq.groupBy(_._1).map{case (_, v) => v}
  val ac = grouped.filter(_.exists(_._2 == "AC")).size
  val wa = (for {
    i <- grouped
    index = i.indexWhere(_._2 == "AC")
    if index >= 0
  } yield index).toSeq.sum
  
  println(s"$ac $wa")
}