import java.util.*

data class Hoge(val p: Int, val s: Boolean, val index: Int)

fun main(args: Array<String>) {
    val (N, M) = readLine()!!.split(" ").map { it.toInt() }
    var success = 0
    var failed = 0
    val ps = Array(M) {
        val list = readLine()!!.split(" ")
        Hoge(list[0].toInt(), list[1] == "AC", it)
    }.groupBy { it.p }.mapValues {
        val tmp = it.value.sortedBy { it.index }
        var suc = 0
        var fail = 0
        for(i in 0 until tmp.size) {
            if (tmp[i].s) {
                suc++
                break
            }
            else {
                fail++
            }
        }
        //println("$suc $fail")
        success += suc
        if (suc > 0)
            failed += fail
    }
    println("$success $failed")
}