console.log((input=>{
  c=input.trim().split("\n").slice(1),a=w=t=r=0
  for(e of c){e=="AC"&&a++,e=="WA"&&w++,e=="TLE"&&t++,e=="RE"&&r++}
  return `AC x ${a}
WA x ${w}
TLE x ${t}
RE x ${r}`
})(require('fs').readFileSync('/dev/stdin','utf8')))