IDENTIFICATION DIVISION.
PROGRAM-ID. B-Bishop.
 
DATA DIVISION.
WORKING-STORAGE SECTION.
01 INP PIC X(22).
01 H   PIC 9(10).
01 W   PIC 9(10).
01 S1  PIC 9(10).
01 S2  PIC 9(10).
01 OUT PIC Z(19)9.
PROCEDURE DIVISION.
MAIN-001.
  ACCEPT INP.
  UNSTRING INP DELIMITED BY ' ' 
      INTO H W. 
*>
  IF (H = 1 OR W = 1)
    MOVE 0 TO OUT
  ELSE
    COMPUTE S1 = H / 2
    COMPUTE S2 = W / 2
    IF (H = S1 * 2) OR (W = S2 * 2)
      COMPUTE OUT = H * W / 2 
    ELSE
      COMPUTE OUT = H * W / 2 + 1
    END-IF
  END-IF.
  DISPLAY FUNCTION TRIM(OUT).
*>
  STOP RUN.
