Task: Program Execution
Input (English): n, 5011, 9767, 3351, N
Output (English): 18129