import java.util.*

fun main(args: Array<String>) {
    val sc = java.util.Scanner(System.`in`)
    val n = sc.nextInt()
    val m = sc.nextInt()
//    val p = mutableListOf<Int>()
//    val s = mutableListOf<Int>()
    val c = Array(n) {0}
    val w = Array(n) {0}
    (1..m).forEach {
        val i = sc.nextInt()
        //p.add(sc.nextInt())
        if (sc.next() == "WA") {
            if (c[i - 1] == 0) {
                w[i - 1] += 1
            }
        } else {
            c[i - 1] = 1
        }
    }
    (0 until n).forEach {
        w[it] *= c[it]
    }
    print("${c.sum()} ${w.sum()}")
}
