IDENTIFICATION DIVISION.
PROGRAM-ID. 173A.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 N          PIC 9(06).
01 S          PIC X(03).
01 TBL.
   03 JUD     PIC 9(06) OCCURS 4.
01 I          PIC 9(06) COMP.
01 OUT        PIC Z(5)9.
*>
PROCEDURE DIVISION.
  ACCEPT N.
*>
  MOVE ZERO TO TBL.
  PERFORM VARYING I FROM 1 BY 1 UNTIL I > N
    ACCEPT S
    EVALUATE S
      WHEN 'AC'
        ADD 1 TO JUD(1)
      WHEN 'WA'
        ADD 1 TO JUD(2)
      WHEN 'TLE'
        ADD 1 TO JUD(3)
      WHEN 'RE'
        ADD 1 TO JUD(4)
    END-EVALUATE
  END-PERFORM.
*>
  MOVE JUD(1) TO OUT.
  DISPLAY 'AC x ' FUNCTION TRIM(OUT).
  MOVE JUD(2) TO OUT.
  DISPLAY 'WA x ' FUNCTION TRIM(OUT).
  MOVE JUD(3) TO OUT.
  DISPLAY 'TLE x ' FUNCTION TRIM(OUT).                                           
  MOVE JUD(4) TO OUT.
  DISPLAY 'RE x ' FUNCTION TRIM(OUT).
  STOP RUN.
