IDENTIFICATION                   DIVISION.
PROGRAM-ID.                      ABC_082_A.
ENVIRONMENT                      DIVISION.
DATA                             DIVISION.
WORKING-STORAGE                  SECTION.
    01 INP    PIC X(7).
    01 a      PIC 9(3).
    01 b      PIC 9(3).

    01 D      PIC 9(3).
    01 R      PIC 9(3).

    01 ZS     PIC Z(3)9.
    01 DUMMY  PIC X(1).

    01 ans    PIC X(3).
PROCEDURE                        DIVISION.
MAIN.
    ACCEPT INP.

    UNSTRING INP
    DELIMITED BY SPACE
    INTO a b.

    ADD a TO b.
    DIVIDE 2 INTO b GIVING D REMAINDER R.
    ADD R TO D.

    MOVE D TO ZS

    PERFORM UNANS.

    DISPLAY ans(1:FUNCTION STORED-CHAR-LENGTH(ans)).
    STOP RUN.

UNANS                            SECTION.
    UNSTRING
        ZS DELIMITED BY ALL SPACE
        INTO DUMMY ans
    END-UNSTRING.
