IDENTIFICATION DIVISION.
PROGRAM-ID. PROGRAM_ID.

DATA DIVISION.
WORKING-STORAGE SECTION.
01 S          PIC X(100).
01 A          PIC 9(10).
01 B          PIC 9(10).
01 i          PIC 9(10).
01 ans        PIC 9(10) VALUE ZERO.
01 zs         PIC Z(9)9.

PROCEDURE DIVISION.
  ACCEPT S.
  PERFORM VARYING i FROM 1 BY 1 UNTIL FUNCTION STORED-CHAR-LENGTH(S) / 2 < i
    IF S(i : 1) <> S(FUNCTION STORED-CHAR-LENGTH(S) - i + 1 : 1) THEN
      ADD 1 TO ans
    END-IF
  END-PERFORM.
  MOVE ans TO zs.
  DISPLAY FUNCTION TRIM(zs).
  STOP RUN.
