fun main(args: Array<String>) {
    val NM = readLine()!!.split(" ").map(String::toInt)
    val res = arrayOfNulls<MutablePair<Boolean, Int>>(NM[0] + 1)
    for (i in 1..NM[1]) {
        val a = readLine()!!.split(" ")
        val p = a[0].toInt()
        val s = a[1]
        if (res[p]?.k == true) continue
        val pair = res[p] ?: MutablePair(false, 0)
        if (s == "WA") pair.v += 1
        else pair.k = true
        res[p] = pair
    }
    val ans = res.filterNotNull().filter { e -> e.k }.map { e -> e.v }
    println("${ans.size} ${ans.sum()}")
}

class MutablePair<A, B>(var k: A, var v: B)