object Main extends App{
    val Array(n, m) = io.StdIn.readLine().split(' ').map(_.toInt)
    val acs = Iterator.continually(io.StdIn.readLine().split(' ')).take(m).map {
        case Array(p, s) => (p.toInt, s)
    }.toSeq.groupBy(_._1).map {
        case (p, ss) => ss.map(_._2)
    }.filter(_.exists(_ == "AC")).toSeq
    
    val correct = acs.length
    val penalty = if (correct == 0)
        0
    else
        acs.map(_.takeWhile(_ == "WA").length).sum
    
    println(s"$correct $penalty")
    
}
