object Main extends App{
    val Array(n, m) = io.StdIn.readLine().split(' ').map(_.toInt)
    val all = Iterator.continually(io.StdIn.readLine().split(' ')).take(m).foldLeft(Map.empty[String, (Int, Int)]) {
        case (acc, Array(p, s)) if s == "AC" && acc.getOrElse(p, (0, 0))._1 != -1 =>
            acc + (p -> (acc.getOrElse(p, (0, 0)) match {
                case (acu, _) => (-1, acu)
            }))
        case (acc, Array(p, s)) if acc.getOrElse(p, (0, 0))._1 != -1 =>
            acc + (p -> (acc.getOrElse(p, (0, 0)) match {
                case (acu, ans) => (acu + 1, ans)
            }))
        case (acc, _) => acc
    }
    
    val answer = all.filter {
        case (_, (acc, _)) => acc == -1
    }
    println(s"${answer.size} ${if (answer.isEmpty) 0 else answer.map(_._2._2).sum}")
    
}
