IDENTIFICATION DIVISION.
PROGRAM-ID. A-AIRPLANE.
 
DATA DIVISION.
WORKING-STORAGE SECTION.
01 INP      PIC X(100).
01 IN-DATA.
   03 DT-X1 PIC X(10).
   03 DT-X2 PIC X(10).
   03 DT-X3 PIC X(10).
01 IN-LEN.
   03 DT-L1 PIC 9(2).
   03 DT-L2 PIC 9(2).
   03 DT-L3 PIC 9(2).
01 IN-P     PIC 9(3).
01 IN-Q     PIC 9(3).
01 IN-R     PIC 9(3).
01 MIN1     PIC 9(3).
01 MIN2     PIC 9(3).
01 OUT-TIME PIC ZZ9.
 
PROCEDURE DIVISION.
MAIN-001.
  ACCEPT INP.
  UNSTRING INP DELIMITED BY ALL ' '
      INTO DT-X1 COUNT IN DT-L1
           DT-X2 COUNT IN DT-L2
           DT-X3 COUNT IN DT-L3.
  MOVE DT-X1(1:DT-L1) TO IN-P.
  MOVE DT-X2(1:DT-L2) TO IN-Q.
  MOVE DT-X3(1:DT-L3) TO IN-R.
 
  IF (IN-P < IN-Q)
    MOVE IN-P TO MIN1
    MOVE IN-Q TO MIN2
  ELSE
    MOVE IN-Q TO MIN1
    MOVE IN-P TO MIN2
  END-IF.
  IF (IN-R < MIN2)
    MOVE IN-R TO MIN2
  END-IF.

  COMPUTE OUT-TIME = MIN1 + MIN2.
  DISPLAY OUT-TIME.

MAIN-EXIT.
  STOP RUN.