fun main() {
    val stat = Stat()
    repeat(readInt()) {
        when (readLine()!!) {
            "AC" -> stat.ac++
            "TLE" -> stat.tle++
            "WA" -> stat.wa++
            "RE" -> stat.re++
        }
    }
    println(stat)
}

data class Stat(var ac: Int = 0, var tle: Int = 0, var wa: Int = 0, var re: Int = 0) {
    override fun toString(): String {
        return "AC x $ac\nWA x $wa\nTLE x $tle\nRE x $re"
    }
}


private fun readInt() = readLine()!!.toInt()
private fun readInts() = readLine()!!.split(" ").map { it.toInt() }
private fun readLongs() = readLine()!!.split(" ").map { it.toLong() }
