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 FL-TIME.
   03 FL-T  PIC 9(3) OCCURS 3 DEPENDING ON CNT.
01 CNT      PIC 9(1) VALUE 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 FL-T(1).
  MOVE DT-X2(1:DT-L2) TO FL-T(2).
  MOVE DT-X3(1:DT-L3) TO FL-T(3).
 
  SORT FL-T ASCENDING KEY FL-T.

  COMPUTE OUT-TIME = FL-T(1) + FL-T(2).
  DISPLAY OUT-TIME.

MAIN-EXIT.
  STOP RUN.