fun main(args: Array<String>) {
    val (n, m) = readIntList()
    val isAc = Array(n) { false }
    val waArr = Array(n) { 0 }
    var ac = 0
    var wa = 0

    repeat(m) {
        val (p, s) = readStringList()
        if (!isAc[p.toInt() - 1]) {
            when (s) {
                "AC" -> {
                    isAc[p.toInt() - 1] = true
                    wa += waArr[p.toInt() - 1]
                    ac++
                }
                "WA" -> {
                    waArr[p.toInt() - 1]++
                }
            }
        }
    }

    println("$ac $wa")
}

// Tools
fun readString() = readLine()!!
fun readInt() = readLine()!!.toInt()
fun readLong() = readLine()!!.toLong()
fun readStringList() = readLine()!!.split(" ")
fun readIntList() = readLine()!!.split(" ").map(String::toInt)
fun readLongList() = readLine()!!.split(" ").map(String::toLong)