fun main(args:Array<String>) {
    val (n,m) = readLine()!!.split(" ").map { it.toInt() }
    val count = (0..n).map { 0 }.toIntArray()
    val ac = (0..n).map { false }.toBooleanArray()

    for(i in (1..m)) {
        val tmp = readLine()!!.split(" ")
        val idx = tmp[0].toInt()
        val isAc = tmp[1] == "AC"
        if(ac[idx]) {
            continue
        }
        if(isAc) {
            ac[idx] = true
        } else {
            count[idx]++
        }
    }
    println("%s %s".format(ac.filter { it }.size, ac.indices.filter { ac[it] }.map { count[it] }.sum()))
}
