       *> AtCoder My Practice
       *> author: Leonardone @ NEETSDKASU
       *>
       IDENTIFICATION DIVISION.
       PROGRAM-ID. Answer.
       ENVIRONMENT DIVISION.
       CONFIGURATION SECTION.
       REPOSITORY.
              FUNCTION ALL INTRINSIC.
       DATA DIVISION.
       WORKING-STORAGE SECTION.
              01 Input-Values.
                     05 a-str  PIC 9(5).
                     05 sp     PIC X.
                     05 b-str  PIC 9(5).
              01 Calc-Values.
                     05 a      BINARY-LONG.
                     05 b      BINARY-LONG.
              01 Answer-Values.
                     05 disp   PIC Z(4)9.
                     05 ans    BINARY-LONG.
       PROCEDURE DIVISION.
       AnswerMain SECTION.
       000-Start.
       
              ACCEPT Input-Values.
              MOVE a-str TO a.
              MOVE b-str TO b.
       
       001-LoopHead.
              MOVE a TO a-str.
              IF a-str(1:1) = a-str(5:1)
              AND a-str(2:1) = a-str(4:1) THEN
                    ADD 1 TO ans
              END-IF.
              ADD 1 TO a.
              IF a > b THEN
                     GO TO 002-OutputAnswer
              END-IF.
              GO TO 001-LoopHead.
      
       002-OutputAnswer.
      	      MOVE ans TO disp.
              DISPLAY TRIM(disp).
       END PROGRAM Answer.
