IDENTIFICATION DIVISION.
PROGRAM-ID. DUPLEX.
 
DATA DIVISION.
WORKING-STORAGE SECTION.
01 INP     PIC X(100).
01 IN-DATA.
   03 DT-X1 PIC X(10).
01 IN-LEN.
   03 DT-L1 PIC 9(2).
01 IN-N     PIC 9(3).
01 OUT-P    PIC Z9.
 
PROCEDURE DIVISION.
MAIN-001.
  ACCEPT INP.
  UNSTRING INP DELIMITED BY ALL ' '
      INTO DT-X1 COUNT IN DT-L1.
  MOVE DT-X1(1:DT-L1) TO IN-N.
 
  COMPUTE OUT-P = (IN-N + 1) / 2.
  DISPLAY OUT-P.
 
MAIN-EXIT.
  STOP RUN.
