      PROGRAM piyo
      IMPLICIT NONE
      INTEGER,PARAMETER :: prec = 16
      integer(prec) :: n,i,awtr(4)=0,num = 1
      character(3) :: s
      
      read*,n
      do i = 1,n
        read*,s(1:3)
        
        select case( s )
          case( 'AC ')
            num = 1
          case( 'WA ' )
            num = 2
          case( 'TLE' )
            num = 3
          case( 'RE' )
            num = 4
        end select
        
        awtr(num) = awtr(num) + 1
      end do
      
      print'(a,i0)','AC x ',awtr(1)
      print'(a,i0)','WA x ',awtr(2)
      print'(a,i0)','TLE x ',awtr(3)
      print'(a,i0)','RE x ',awtr(4)
      
      
      
      stop
      !debugg
      
      
      
      END PROGRAM