

import java.util.*
fun main(args: Array<String>) {

    val (N, M) = readLine()!!.split(" ").map(String::toInt)

    var map = LinkedHashMap<String,Problem>()

    for(i in 0 until M){

        val submit = readLine()!!.split(" ")
        val problemNum = submit[0]
        val accept = submit[1]=="AC"

        if(!map.containsKey(problemNum)){
            if(accept){
                map[problemNum] = Problem(0,accept)
            }else{
                map[problemNum] = Problem()
            }
        }else{
            if(!map[problemNum]!!.accept){
                if(accept){
                    map[problemNum]!!.accept = true
                }else{
                    map[problemNum]!!.wrong+=1
                }
            }
        }
    }

    var ac = 0
    var wc = 0
    for(problem in map.values){
        if(problem.accept){
            ac++
            wc+=problem.wrong
        }
    }

    println("$ac $wc")
}

class Problem(var wrong : Int = 1,var accept : Boolean = false)