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).filter {
        case (p, ss) => ss.exists(_._2 == "AC")
    }
    
    val corrects = acs.size
    val penalty = acs.map {
        case (p, ss) =>
            ss.takeWhile(_._2 == "WA").length
    }.sum

    println(s"$corrects $penalty")
}
