IDENTIFICATION DIVISION.
PROGRAM-ID. PROGRAM_ID.

DATA DIVISION.
WORKING-STORAGE SECTION.
01 LN         PIC X(21).
01 S          PIC X(10).
01 T          PIC X(10).
01 U          PIC X(10).
01 A          PIC 9(2).
01 B          PIC 9(2).
01 ZA         PIC Z9.
01 ZB         PIC Z9.

PROCEDURE DIVISION.
  ACCEPT LN.
  UNSTRING LN DELIMITED BY SPACE INTO S T.
  ACCEPT LN.
  UNSTRING LN DELIMITED BY SPACE INTO A B.
  ACCEPT U.
  IF S = U
      ADD -1 TO A
  ELSE
      ADD -1 TO B
  END-IF.
  MOVE A TO ZA.
  MOVE B TO ZB.
  DISPLAY ZA ZB.
