IDENTIFICATION DIVISION.
PROGRAM-ID. 124A.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 INP PIC X(10).
01 A   PIC 9(2).
01 B   PIC 9(2).
01 OUT PIC Z9.
*>
PROCEDURE DIVISION.
  ACCEPT INP.
  UNSTRING INP DELIMITED BY ' '
      INTO A B.
*>
  EVALUATE TRUE
    WHEN A = B
      COMPUTE OUT = A * 2
    WHEN A > B
      COMPUTE OUT = A * 2 - 1
    WHEN A < B
      COMPUTE OUT = B * 2 - 1
  END-EVALUATE.
*>
  DISPLAY FUNCTION TRIM(OUT).
  STOP RUN.
 