fun main(args: Array<String>) {
    val (n, m) = readLine()!!.split(" ").map(String::toInt)
    val set = mutableSetOf<String>()
    var p = mutableMapOf<String, Int>()

    repeat(m) {
        val (mondai, result) = readLine()!!.split(" ")
        if (!set.contains(mondai)) {
            if (result == "WA") {
                p.put(mondai, p.getOrElse(mondai, { 0 }) + 1)
            } else {
                set.add(mondai)
            }
        }
    }

    var psum = 0
    for (v in set) {
        psum += p.getOrElse(v, { 0 })
    }
    println("${set.size} ${psum}")
}

