Task: Program Execution
Input (English): n, 5031, 2989
Output (English): 8020