fun main(args: Array<String>) {
    abc151c()
}

fun abc151c() {
    val (n, m) = readLine()!!.split(' ').map { it.toInt() }
    val psList = (1..m).map { readLine()!!.split(' ').let { Pair(it[0].toInt(), it[1]) } }

    val ac = psList.groupBy { it.first }.map { if (it.value.any { it.second == "AC" }) 1 else 0 }.sum()

    val group = psList.groupBy { it.first }.map { it.value }.map {
        it.indexOfFirst { it.second == "AC" }.let { if (it == -1) 0 else it }
    }

    val pen = group.sum()

    val answer = "$ac $pen"

    println(answer)
}
