 IDENTIFICATION DIVISION.
 PROGRAM-ID. TEST103.

 DATA DIVISION.
 WORKING-STORAGE SECTION.

 01 INP    PIC X(100).
 01 A1     PIC 9(3).
 01 A2     PIC 9(3).
 01 A3     PIC 9(3).
 01 C1     PIC 9(3).
 01 C2     PIC 9(3).
 01 ANS    PIC ZZ9.

 PROCEDURE DIVISION.
 
  ACCEPT INP.
  UNSTRING INP DELIMITED BY ALL ' '
      INTO A1 A2 A3.

  IF A1 > A3
    COMPUTE C1 = A1 - A3
  ELSE
    COMPUTE C1 = A3 - A1
  END-IF.

  IF A2 > A3
    COMPUTE C2 = A2 - A3
  ELSE
    COMPUTE C2 = A3 - A2
  END-IF.

  COMPUTE ANS = C1 + C2.
  DISPLAY ANS.

  STOP RUN. 