       IDENTIFICATION DIVISION.
       PROGRAM-ID. test1.
       ENVIRONMENT DIVISION.
       DATA DIVISION.
       WORKING-STORAGE SECTION.
       01 INP PIC X(100).
       01 A PIC 99999.
       01 B PIC 99999.
       01 temp1 PIC 9999.
       01 temp2 PIC 9999.
       01 N PIC 9999.
       01 RE PIC 9.
       PROCEDURE DIVISION.
       MAIN.
      	MOVE 0 TO RE.
       	ACCEPT INP.
      	PERFORM VARYING N FROM 1 BY 1 UNTIL N = 4
      		MOVE INP(N:1) TO A
      		IF A = 1 THEN
      			ADD 1 TO RE
      		END-IF
      	END-PERFORM.
      	DISPLAY RE.
        STOP RUN.


