fun main(args: Array<String>) {
    val l = readLine()!!.split(' ').map { it.toInt() }
    val accepted: MutableSet<Int> = mutableSetOf()
    var wrongAns: IntArray = IntArray(l[0]) { 0 }
    var penaltySum = 0
    for (i in 0 until l[1]) {
        val tmp = readLine()!!.split(' ')
        val problemNum = tmp[0].toInt()-1
        if (tmp[1] == "AC") {
            if (accepted.add(problemNum)) penaltySum += wrongAns[problemNum]
        } else {
            if (!accepted.contains(problemNum)) {
                wrongAns[problemNum]++
            }
        }
    }
    println("${accepted.size} $penaltySum")
}
