000100 IDENTIFICATION DIVISION.
000200 PROGRAM-ID. STONE-MONUMENT.
000300 DATA DIVISION.
000400 WORKING-STORAGE SECTION.
000500 01 ANS PIC Z(6).
000600 01 I   PIC 9(6).
000700 01 J   PIC 9(6).
000800 01 BUF PIC X(13).
000900 01 POS PIC 9(2).
001000 PROCEDURE DIVISION.
001100     ACCEPT BUF FROM CONSOLE
001200     PERFORM VARYING POS FROM 0 BY 1
001300     UNTIL BUF(POS:1) IS EQUAL TO SPACE
001400     END-PERFORM
001500     SUBTRACT 1 FROM POS
001600     MOVE BUF(1:POS) TO I
001700     ADD 1 TO POS
001800     MOVE BUF(POS:6) TO J
001900     COMPUTE ANS = (J - I) * (J - I + 1) / 2 - J
002000     DISPLAY ANS UPON CONSOLE
002100     STOP RUN.
