import java.util.*

fun main(args: Array<String>) {
    val (n, k) = readLine()!!.split(" ").map { it.toInt() }
    val c = HashMap<Int, Boolean>()
    val penalty = HashMap<Int, Int>()
    repeat(k) {
        val input = readLine()!!.split(" ")
        val index = input[0].toInt()
        val hit = input[1] == "AC"

        if (hit) c[index] = true
        else if (!(c[index] ?: false)) {
            val temp = penalty[index] ?: 0
            penalty[index] = temp + 1
        }
    }

    val score = c.filter { it.value }.count()
    val pscore = c.filter { it.value }.map { it.key }.mapNotNull { penalty[it] } .sum()
    println("$score $pscore")
}
