IDENTIFICATION DIVISION.
PROGRAM-ID. 099C.
*>
DATA DIVISION.
WORKING-STORAGE SECTION.
01 INP        PIC  X(14).
01 N          PIC  9(6) COMP.
01 K          PIC  9(6) COMP.
01 OUT        PIC  Z(5)9.
*>
PROCEDURE DIVISION.
  ACCEPT INP.
  UNSTRING INP DELIMITED BY ' '
      INTO N K.
*>
  COMPUTE OUT = (N - 2) / (K - 1) + 1.
  DISPLAY FUNCTION TRIM(OUT).
*>
  STOP RUN.
