fun main(args: Array<String>) = println(run {
    val (n,m)= readLine()!!.split(" ").map { it.toInt() }
    val ps = (1..m).map { readLine()!!.split(" ") }
    val result = ps.groupBy { it[0] }.mapValues {
        it.value.map { it[1] }
    }

    val ac = result.filter { "AC" in it.value }.count()
    val wa = result.filter { "AC" in it.value }.map { it.value.takeWhile { it == "WA" }.count() }.sum()

    "$ac $wa"
})