fun main(arr: Array<String>) {
    val (n,m) = readLine()!!.split(" ").map { it.toInt() }
    val isAC = (1..n).map { false }.toMutableList()
    val countWa = (1..n).map { 0 }.toMutableList()
    for(i in (1..m)) {
        val inpt = readLine()!!.split(" ")
        val idx = inpt[0].toInt()-1
        if(inpt[1] == "AC") {
            isAC[idx] = true
        } else if(!isAC[idx]) {
            countWa[idx]++
        }
    }
    isAC.indices.filter { !isAC[it] }.forEach { countWa[it] = 0 }
    println("${isAC.count { it }} ${countWa.sum()}")
}