object Main extends App{
val List(n,m) = readLine.split(" ").map(_.toInt).toList
var cnt = m
var map = scala.collection.mutable.HashMap.empty[Int,Int]
var ac,wa = 0
while(cnt != 0){
    val List(p_str,s) = readLine.split(" ").toList
    val p = p_str.toInt
    if(!map.contains(p)){ // mapにpが存在しない時
        if(s == "AC"){
            map += (p -> 1)
            ac += 1
        }else{
            map += (p -> 0)
            wa += 1
        }
    }else{ // mapにpが存在する時
        if(s == "AC" && map.get(p).get == 0){
            map.update(p,1)
            ac += 1
        }else if(s == "WA" && map.get(p).get == 0){
            wa += 0
        }else{            
        }
    }
    println(ac + " " + wa + " " + map)
    cnt -= 1
}
println(ac + " " + wa)
}