Task: Program Execution
Input (English): I, 2877, 1707, 2405
Output (English): 6989