<?php
$ac = 0;
$wa = 0;
$tle = 0;
$re = 0;
$num = trim(fgets(STDIN));
for($i=0; $i<$num; $i++){
    $result = trim(fgets(STDIN));
    switch($result){
        case $result == "AC":
            $ac += 1;
        break;
        case $result == "WA":
            $wa += 1;
        break;
        case $result == "TLE":
            $tle += 1;
        break;
        case $result == "RE":
            $re += 1;
        break;
    }
}
echo "AC × $ac"."\n"."WA × $wa"."\n"."TLE × $tle"."\n"."RE × $re";

?>