IDENTIFICATION DIVISION.
PROGRAM-ID. NOMURA-A.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 INP        PIC X(100).
01 H1         PIC 9(02).
01 M1         PIC 9(02).
01 H2         PIC 9(02).
01 M2         PIC 9(02).
01 K          PIC 9(04).
01 W          PIC 9(04).
01 OUT        PIC ZZZ9.
*>
PROCEDURE DIVISION.
  ACCEPT INP.
  UNSTRING INP DELIMITED BY ' '
      INTO H1 M1 H2 M2 K.
*>
  COMPUTE W = H2 * 60 + M2 - (H1 * 60 + M1).
  COMPUTE OUT = W - K.
*>
  DISPLAY FUNCTION TRIM(OUT).
  STOP RUN.
