fun main(args: Array<String>) {
    val (n, m) = readIntegerList()
    val isAcArray = Array(n + 1) { false }
    val waCountArray = Array(n + 1) { 0 }
    for (i in 0 until m) {
        val (p, s) = readStringList()
        val pNum = p.toInt()

        if (isAcArray[pNum]) {
            continue
        }

        if (s == "AC") {
            isAcArray[pNum] = true
        } else {
            waCountArray[pNum]++
        }
    }

    var acCount = 0
    var waCount = 0
    for (i in isAcArray.indices) {
        if (isAcArray[i]) {
            acCount++
            waCount += waCountArray[i]
        }
    }

    println("$acCount $waCount")
}

fun readInteger() = readLine()!!.toInt()
fun readLong() = readLine()!!.toLong()
fun readStringList() = readLine()!!.split(" ")
fun readIntegerList() = readStringList().map(String::toInt)
fun readLongList() = readStringList().map(String::toLong)
