import kotlin.math.ceil

fun next() = readLine()!!
fun nextInt() = next().toInt()
fun nextLong() = next().toLong()
fun nextDouble() = next().toDouble()
fun nextList() = next().split(" ")
fun nextIntList() = next().split(" ").map{ it.toInt() }
fun nextLongList() = next().split(" ").map{ it.toLong() }
fun nextDoubleList() = next().split(" ").map{ it.toDouble() }
fun nextListNull() = next().split("").filter { it != "" }.map{ it.toInt() }

/* fun main(args: Array<String>){
  val a = nextInt()
  println("$a")
} */

        // template
        /*
        A 500
        B 100
        C 50
        X 合計
         */

        // input
        /*
        30
        40
        50
        6000
         */

        // output
        /*
        213
         */
        fun main(args: Array<String>){
            val output = 0
            val n = nextInt()
            var ac = 0
            var wa = 0
            var tle = 0
            var re = 0

            for (i in 1..n) {
                val si = next()
                when (si) {
                    "AC"  -> ac++
                    "WA"  -> wa++
                    "TLE" -> tle++
                    "RE"  -> re++
                }
            }

            println("AC x $ac")
            println("WA x $wa")
            println("TLE x $tle")
            println("RE x $re")
        }