fun main(args: Array<String>) {
  var N = readLine()!!.toInt()
  var AC_count = 0
  var WA_count = 0
  var TLE_count = 0
  var RE_count = 0
  for (n in 0 until N) {
    var result = readLine()!!
    
    when(result) {
      "AC" -> AC_count++
      "WA" -> WA_count++
      "TLE" -> TLE_count++
      "RE" -> åRE_count++
    }
  }
  println("AC x $AC_count")
  println("WA x $WA_count")
  println("TLE x $TLE_count")
  println("RE x $RE_count")
}