ac=0
wa=0
tle=0
re=0

read n
for (( i = 0; i < $n; i++ )); do
  read s
  case $s in
    AC  ) ac=$(( $ac + 1 )) ;;
    WA  ) wa=$(( $wa + 1 )) ;;
    TLE ) tle=$(( $tle +1 )) ;;
    RE  ) re=$(( $re + 1 )) ;;
  esac
done

echo "AC x $ac"
echo "WA x $wa"
echo "TLE x $tle"
echo "RE x $re"