fun main(args : Array<String>) {
    val (n, m) = readLine()!!.split(" ").map { it.toInt() }
    val ac = mutableSetOf<String>()
    val wa = mutableMapOf<String, Int>()

    repeat(m) {
        val (p, s) = readLine()!!.split(" ")
        if (ac.contains(p)) return@repeat

        if (s == "WA") {
            wa[p] = wa.get(p)?.plus(1) ?: 1
        }
        if (s == "AC") {
            ac.add(p)
        }
    }

    var waCnt = 0
    wa.forEach {
        if (ac.contains(it.key)) waCnt += it.value
    }

    println("${ac.size} $waCnt")
}