Task: Program Execution
Input (English): 2, 8, ['p', 'W', '605', '1947', '2193', '2735', 'h', '9667', '5207']
Output (English): 17147