 IDENTIFICATION DIVISION.
 PROGRAM-ID. TEST129.

 ENVIRONMENT DIVISION.

 DATA DIVISION.
 WORKING-STORAGE SECTION.

 01 INP      PIC X(100).
 01 P        PIC 9(3).
 01 Q        PIC 9(3).
 01 R        PIC 9(3).
 01 A1       PIC 9(5).
 01 A2       PIC 9(5).
 01 A3       PIC 9(5).
 01 ANS      PIC ZZZZ9.

 PROCEDURE DIVISION.

 ACCEPT INP.
 UNSTRING INP DELIMITED BY ALL ' '
  INTO P Q R.

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

 EVALUATE TRUE
  WHEN (A1 < A2) AND (A1 < A3)
  WHEN (A1 = A2) AND (A1 < A3)
    MOVE A1 TO ANS 
  WHEN (A2 < A1) AND (A2 < A3)
  WHEN (A2 = A3) AND (A2 < A1)
    MOVE A2 TO ANS
  WHEN (A3 < A1) AND (A3 < A2)
  WHEN (A3 = A1) AND (A3 < A2)
    MOVE A3 TO ANS
  WHEN OTHER
    MOVE A1 TO ANS
 END-EVALUATE.

 DISPLAY ANS.
 
 STOP RUN. 