object Main extends App {
	val sc = new java.util.Scanner(System.in)
	val n, m = sc.nextInt
	val ps = List.fill(m)((sc.nextInt, sc.next)).groupBy(_._1).toList.map(_._2)
	
	println(s"${ps.filter(_ exists (_._2 == "AC")).size} ${ps.map(_.indexWhere(_._2 == "AC")).sum}")
}