fun main(args: Array<String>) {
    val (n, m) = readLine()!!.split(' ').map { it.toInt() }
    val isAccepted = Array(n) {false}
    val waCount = Array(n) {0}
    var ans = 0
    repeat(m) {
        val ss = readLine()!!.split(' ')
        val p = ss[0].toInt() - 1
        when (ss[1]) {
            "WA" -> waCount[p]++
            else -> if (!isAccepted[p]) {
                ans += waCount[p]
                isAccepted[p] = true
            }
        }
    }
    println("${isAccepted.count{it}} $ans")
}