IDENTIFICATION DIVISION.
PROGRAM-ID. PROGRAM_ID.

DATA DIVISION.
WORKING-STORAGE SECTION.
01 LN             PIC X(30).
01 N              PIC 9(10).
01 M              PIC 9(10).
01 zs             PIC Z(9)9.

PROCEDURE DIVISION.
  ACCEPT LN.
  UNSTRING LN DELIMITED BY SPACE INTO N M.
  COMPUTE zs = N * (N - 1) / 2 + M * (M - 1) / 2.
  DISPLAY zs.
  STOP RUN.
