import java.util.*

fun main(args: Array<String>) {
  val sc = Scanner(System.`in`)
  val n = sc.nextInt()
  val m = sc.nextInt()

  val ac = mutableMapOf<Int, Int>()
  val wa = mutableMapOf<Int, Int>()
  for (i in 0 until m) {
    val pi = sc.nextInt()
    val si = sc.next()
    if (ac.containsKey(pi)) {
      continue
    } else {
      when (si) {
        "AC" -> ac[pi] = 1
        "WA" -> wa[pi] = wa[pi]?.plus(1) ?: 1
      }
    }
  }
  println("${ac.values.sum()} ${wa.filter { ac.containsKey(it.key) }.values.sum()}")
}