fun main(args: Array<String>) {
    val (N, M) = readInputLine().split(" ").map { it.toInt() }

    val ac = BooleanArray(N)

    var pen = IntArray(N)

    for (i in 0 until M) {
        val (p, S) = readInputLine().split(" ")
        val pNum = p.toInt() - 1

        if (ac[pNum]) {
            continue
        }

        if (S == "AC") {
            ac[pNum] = true
        } else {
            pen[pNum]++
        }
    }

    var acSum = 0
    var penSum = 0

    for (i in 0 until N) {
        if (ac[i]) {
            acSum++
            penSum += pen[i]
        }
    }

    println("$acSum $penSum")
}

fun readInputLine(): String {
    return readLine()!!
}
