IDENTIFICATION DIVISION.
PROGRAM-ID. ABC111B.

DATA DIVISION.
WORKING-STORAGE SECTION.
77 N PIC 999.

PROCEDURE DIVISION.
ACCEPT N.
COMPUTE N = (N + 110) / 111.
COMPUTE N = N * 111.
DISPLAY N.
STOP RUN.
