read num

AC=0
WA=0
TLE=0
RE=0

for index in $(seq 1 ${num}); do
    read input
    case "${input}" in
        "AC") (( AC++ ));;
        "WA") (( WA++ ));;
        "TLE") (( TLE++ ));;
        "RE") (( RE++ ));;
    esac
done

printf "AC x %d\n" "${AC}"
printf "WA x %d\n" "${WA}"
printf "TLE x %d\n" "${TLE}"
printf "RE x %d\n" "${RE}"