 IDENTIFICATION DIVISION.
 PROGRAM-ID. TEST129.

 ENVIRONMENT DIVISION.

 DATA DIVISION.
 WORKING-STORAGE SECTION.

 01 INP.
  03 P       PIC 9(2).
  03 FILLER  PIC X(1).
  03 Q       PIC 9(2).
  03 FILLER  PIC X(1).
  03 R       PIC 9(2).

 01 A1       PIC 9(3).
 01 A2       PIC 9(3).
 01 A3       PIC 9(3).

 01 ANS      PIC ZZ9.

 PROCEDURE DIVISION.

 ACCEPT INP.

 COMPUTE A1 = P + Q.
 COMPUTE A2 = Q + R.
 COMPUTE A3 = P + R.

 IF A1 < A2
  IF A1 < A3
    MOVE A1 TO ANS
    DISPLAY ANS
  END-IF
 END-IF.

 IF A2 < A1
  IF A2 < A3
    MOVE A2 TO ANS
    DISPLAY ANS
  END-IF
 END-IF.

 IF A3 < A1
  IF A3 < A2
    MOVE A3 TO ANS
    DISPLAY ANS
  END-IF
 END-IF.

 STOP RUN. 