<?php
$ac = 0;
$wa = 0;
$tle = 0;
$re = 0;
 
$num = trim(fgets(STDIN));
 
for($i=0; $i<$num; $i++){
    $text = trim(fgets(STDIN));
    if($text == "AC"){
        $ac += 1;
    }elseif($text == "WA"){
        $wa += 1;
    }elseif($text == "TLE"){
        $tle += 1;
    }else{
        $re += 1;
    }
}
 
echo "AC × ".$ac."\n";
echo "WA × ".$wa."\n";
echo "TLE × ".$tle."\n";
echo "RE × ".$re;
?>