fun main(args: Array<String>) {
    val (n, m) = readLine()!!.split(" ").map(String::toInt)
    val pairs = (0 until m).map { readLine()!!.split(' ').let { Pair(it[0].toInt(), it[1]) } }
    val group = pairs
            .groupBy { it.first }

    val ac = group.map { if(it.value.any { it.second == "AC" }) 1 else 0 }.sum()
    val wa = group
            .map {it.value}
            .map { it.indexOfFirst { it.second == "AC" }.let { if (it == -1) 0 else it } }
            .sum()
    println("$ac $wa")
}

